CS 2114 Lecture Notes - Lecture 15: Double-Ended Queue, Mobile Suit Gundam, Pi Day

40 views1 pages

Document Summary

Project iii tower of hanoi is due friday, march 23. Opendsa homework on recursion is due sunday, march 18 ~ very involved questions and are very important! Queues: the item added first is at the front; fifo / first in first out. ***note: don"t need to include assert statements within regular methods. getfront(): t isempty(): boolean clear(): void. Linked implementation: enqueue(t newentry): void (gets added to the back of the line); performance is (cid:4666)1(cid:4667). Dequeue(): t (gets off the front of the line); performance is (cid:4666)1(cid:4667). Major efficiency benefit to having a reference to the last node (don"t. Need references for the first and last node of the linked chain. have to traverse the chain, but make sure it is kept track of). Deques: have both queuelike operations and stacklike operations; a double ended queue. addtofront(t item): void / addtoback(t item): void removefront(): t / removeback(): t getfront(): t / getback(): t isempty(): boolean clear(): void.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents