CSC148H1 Lecture Notes - Lecture 11: Linked List
katrinasavvy and 38715 others unlocked
1
CSC148H1 Full Course Notes
Verified Note
1 document
Document Summary
References: code seen in the pictures can be found on the csc148 website: http://www. teach. cs. toronto. edu/~csc148h/winter/ Some things on old tests might not have been taught yet in this class. Only tested on things up to wed, jan 31 class. Given structure of a linked list, can add to front of back: add in linkedlistnode class. If you prepend a node, front, back, and size may change: e. g. linked list with size 0. Draw yourself a picture to know what changes. List class keeps track of info about entire list. Make reference to (at least 1) node and move it along the list cur_node = self. front. Create new node and add it before self. front. If linked list exists: size can be 0, front and back = none, size is greater than0, front and back is pointing at nodes, size = 1, front and back pointing at same node. New node"s next points to old front.