Linked Lists

In Python we use lists rather arrays. Although, for our purpose they are one in the same. A node (element) in a linked list contains two fields:

  • Data (of any data type)
  • A pointer that points to the next element in the list
  • We could introduce a ‘previous’ field into the node but we shall just focus on the fore-mentioned fields.

    Also, we must keep track of the size of the list and a pointer that holds the position of the beginning of the list.

    Further reading:

  • Wikipedia – linked lists
  • Tutorials – linked lists
  • We shall build