COMP 2012H Honors Object-Oriented Programming and Data Structures

Lab 4 Linked List

Common Errors

  1. Forgetting to handle the special cases of node insertion/removal when there are only 0, 1, or 2 nodes in the linked list.

  2. Removing the wrong node, especially when the target is the the 2nd node (front->next) or the 2nd-last node (back->prev).

  3. Inserting the node in the incorrect position, shifted by +-1 than the expectation.

  4. Incorrectly updating the neighboring nodes' prev and next pointers during node insertion/removal.

  5. destroy_deque() forgetting to also call destroy_node to actually deallocate heap memory.