0

Does python allocate memory in a continuous fashion in memory while implementing list or use a dynamic allocation?

If continuous, how does it append new elements? It should cause problems in implementing a large list.

How does this actually work?

Gaurav
  • 333
  • 1
  • 16

1 Answers1

0

I don't know how it is implemented behind the hood, but as it is accessible by index it doesn't look like a linked list. To me, it looks like a vector of pointers/references, but I could be totally wrong.

Awen
  • 58
  • 5
  • Hey, I found this amazing post http://www.laurentluce.com/posts/python-list-implementation/ and I got cleared about it. Hope it helps you too. – Gaurav Jul 15 '21 at 12:11