–tags: Data Structures

Lists:

  • Simple but better than array in some terms and worse in some terms
  • Basic concept of list and actual implementation of a list in a particular language
  • Collections of different items
  • Direct access vs Sequential access
  • Arrays can be jumped directly using the iterators for direct access
  • List structure is not based on sequential iteration: don’t need to be side by side in memory
  • The object first one locates the second node and so on.
  • Adding and removing elements is very easy in list

Single and doubly linked lists:

  • One more reference to the previous data to go forward and backward
  • Mostly implemented as double linked list
  • last element of the list points to terminator or the sentinel node
  • Circular linked list so that last item points back to the first item

Lists use:

  • Interface list in java
  • Arraylist as array with less operations of lists
  • linkedlist is doubly linked in java and we can iterate the doubly linked list but not much of
  • benifit
  • lists are dynamic arrays in python