CSCA48H3 Lecture Notes - Lecture 8: Linked List, Init, Empty String

154 views10 pages

Document Summary

Csca48 - lecture 08 - circular linked lists + double linked lists. Each item that is removed might be inserted to the back of the queue again. The only data structure we have available now is the single linked list . It is a better idea to move the pointer forward instead of repeatedly run dequeue() and enqueue() This pointer points to the tail of the queue. Needs only one pointer, cursor , to point to the node that will be processed next. Move the pointer forward when the node receives a service. To add a node immediately after the cursor. Remove the node immediately after the cursor. Advance the cursor to the next node in the linked list. Circular linked list code + explanation class emptycircularlinkedlist(): pass. An exception class which will raise an exception if attempting to remove a node from an empty circular linked list.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents