C S 313E Lecture Notes - Lecture 4: Double-Ended Queue, Data Type, Linked List

60 views2 pages
30 May 2019
School
Course
Professor

Document Summary

Hybrid between a stack and a queue. Can remove and add from either end. D = deque(): creating a new empty deque. D. addrear(item): adds an item to the back of the deque. D. addfront(item): adds an item to the front of the deque. Item = d. removerear(): removes the item from the back of the deque. Item = d. removefront(): removes the item from the front of the deque. Same isempty() and size() functions as stacks and queues. Concrete data types: data type that is tied to the internal representation of a collection"s data. Not the same as a python list. Need an external pointer that identifies the first element ( head pointer) Each element points to the next one. The last element needs to know it"s the last one. Same methods are stacks/queues for isempty() and size() Similar to unordered list but in ascending order. Data field: pointer to data item stored at that node.

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