
Arrays vs ArrayLists vs Linked Lists (Does Python Even Have Arrays?)
·9 mins
An array stores items of one type in equal slots next to each other in memory, but a Python list can grow and hold items of any type. In this chapter, we start from memory as one long row of bytes and build up arrays, the stack and the heap, pointers, dynamic arrays like Java’s ArrayList, CPython’s list, and linked lists. Then we reason through what each operation costs in an array, a list, and a linked list, and how those costs add up in a coding interview.
