12LinearStructures

12LinearStructures - CMSC 132: Object-Oriented Programming...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 132: Object-Oriented Programming II Linear Data Structures Department of Computer Science University of Maryland, College Park
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview Linear data structures General properties Implementations Array Linked list Restricted abstractions Stack Queue
Background image of page 2
Linear Data Structures 1-to-1 relationship between elements Each element has unique predecessor & successor Results in total ordering over elements For any two distinct elements x and y, either x comes before y or y comes before x
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Linear Data Structures Terminology Head (first element in list) no predecessor Tail (last element in list) no successor Operations Add element Remove element Find element
Background image of page 4
Add an element Where? At head (front) of list At tail (end) of list After a particular element Remove an element Remove first element Remove last element Remove a particular element (e.g., String “Happy”) What if “Happy” occurs more than once in list?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Accessing Elements How do you find an element? At head (front) of list
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 24

12LinearStructures - CMSC 132: Object-Oriented Programming...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online