ITEC 2620 Study Guide - Final Guide: Linked List

51 views6 pages

Document Summary

Inserting into linked lists: insert an element into a linked list, sorted from smallest to largest, e. g. list. insert(newvalue, use two pointers: Special case: inserting at the front or into empty list. General case: inserting into the middle: when before is larger. 11 newvalue: if new value is smallest, or if list is empty, must update list. List is assigned newvalue: find insertion location: Week #5-b february 5, 2020 page 1 of 6. Deleting from linked lists: when before is null. Newvalue. next is assigned before: find insertion location: 17 newvalue: delete an element from a linked list sorted from smallest to largest, e. g. list. delete(target, use two pointers. Special case: deleting at the front of the linked list. Prev: if deleted value is smallest (first link), must update list. List. next is assigned list: before deletion: Week #5-b february 5, 2020 page 2 of 6. Inserting into a binary search tree: insertion always happens at the bottom of the tree.