Drawing Doubly Linked Lists

Drawing Doubly Linked Lists

A great technique for coming up with algorithms to act on data structures is drawing out what the final data structure will look like and thinking about what needs to be updated to get it there. With a partner, draw a doubly linked list like the above after each of the following changes.

  1. Adding item “a” to the beginning of the list
  2. Adding item “b” to the end of the list
  3. Adding item “c” at index 1 of the list
  4. Adding item “d” at index 2 of the list
  5. Removing the item from the beginning of the list
  6. Removing the item from the end of the list
  7. Removing the item from index 1 of the list

To submit your work, take a picture of your drawings after each step above and add the picture(s) to your github repository for Lab 4