CS136 Lecture Notes - Lecture 20: Linked List, Accorhotels, Information Hiding
Document Summary
Adts in c: uses dynamic memory, information hiding. Flexibility: opaque structure, assert your requirement. Stack adt: one of collection adt, similar to maximum-length array. No maximum (store an arbitrary number of integers) change length accor dingly. Linked lists: each node contains an item and a pointer, last node is a sentinel value (null) Tuesday, march 20, 2018: represented as a pointer to the front, not arranged sequentially in memory, the list must be traversed form the front o(n) 1 university of waterloo, cs 136 winter 2018, 11-linked_data_structure, p12, snapshot ted by author. New nodes shall only be created (malloc"d) Linked lists in c: declare a linked list node, item, pointer, for the last node, such pointer is null, wrapper strategy. Wrap the link to the first node of a list inside of another structure. Traversing a list: iteratively or recursively. Destroying a list: must be able to free, every node and list wrappers.