CS 162 Lecture Notes - Lecture 24: Binary Tree, Linked List, Nerf

38 views3 pages
CS 162 Lecture 24 Data Structures
Data Structures
o The conceptual shape or arrangement of the data
o Arrays
Stored in contiguous memory
Random access to data elements
Same data
o Lists
Not stored contiguously
No random access
Any data of the same type
o Dynamic
Grouping data together
Sequential ordering
Abstract Data Types
o Stack: entries are only inserted and removed at the head
Last in, First out (LIFO)
Push: add to the top/front
Pop: remove from the top/front
Ideal for storing items that must be retrieved in the reverse order from
which they are stored
Examples:
Stack of plates
Recursion
o Sum(list)
If len==0
Return val
Return sum(list-1)+val
Parking in Corvallis
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

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