English

How are lists implemented in memory?

Advertisements
Advertisements

Question

How are lists implemented in memory?

Short Answer
Advertisements

Solution

  • A Python list is implemented as a variable-length array.
  • It stores contiguous references (pointers) to objects, not necessarily the objects themselves.
  • A list header stores a pointer to this reference array and its length.
  • When an item is inserted or appended, Python may resize the array of references.
shaalaa.com
  Is there an error in this question or solution?
Chapter 5: Liner List Manipulation - EXERCISE [Page 104]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 5 Liner List Manipulation
EXERCISE | Q 4. | Page 104
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×