CS 2114 Lecture Notes - Lecture 15: Double-Ended Queue, Mobile Suit Gundam, Pi Day
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.