2.2-ADT_List - CMPT 225 Unit 2 Abstract Data Type (ADT)...

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

View Full Document Right Arrow Icon
CMPT 225 Unit 2 Abstract Data Type (ADT) List
Background image of page 1

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

View Full DocumentRight Arrow Icon
CMPT 225 Concept of a List • Examples of real-world lists: • a list of textbooks to purchase • a grocery list • one day in our day planner • a class list
Background image of page 2
CMPT 225 Types of List 1. Position-oriented list where elements are referenced by their position within a list Textbook 2. Value-oriented list where elements are referenced by their value (one or more data member(s)) Lab Assignment 1 Maybe sorted: Textbook – sorted List
Background image of page 3

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

View Full DocumentRight Arrow Icon
CMPT 225 An Aside: Ordered versus Sorted Ordered When a collection is ordered, one can iterate through the collection in a specific (not-random) order. Example: An list keeps the order established by the position of the objects (insertion order). A set does not. Sorted A sorted collection means that the order in the collection is determined according to some rule, known as the sort order.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

2.2-ADT_List - CMPT 225 Unit 2 Abstract Data Type (ADT)...

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

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