Workshop 1 Flashcards
Data Structures - 2 parts
Collection of elements, either data type or another data structure.
Set of associations or relationships, involving collection of elements.
Algorithim
Sequence of steps that takes an input and and output.
Candidate Solutions
Different Algorithms.
Linear Structure
Unique predecessor and unique successor.
e.g. stack, queue
Hierarchal Structure
Unique predecessor and many successors.
eg. management structure, family tree
Graph Structure
Many predecessors and many successors.
eg. railway map, computer network.
Set Structure
No predecessors and no successors.
eg. YOU (students studying this unit)
ADT
Abstract Data Type
Data collection and associated methods stored in a single module.
ADT data
Cannot be accessed directly, data is accessed indirectly through methods.
ADT details
High Level Description.
Concerned with WHAT it can do.
Implementation Independent.
Data Structure Details
Concrete Description.
Concerned with HOW task is done.
Implementation dependent.
Stack ADT
Collection of objects where most recently inserted objects can be removed at anytime.
Linear Data Structure, Last-In First-Out.
Stack ADT types
Push - Add an item on top of stack
Pop - Remove an item on top of stack
Peek - Examine item at top of stack
Empty - Determine if stack is empty.
Full - Determine if stack is full.
Stack ADT will expect the ADT to throw an exception if:
Push operation is requested on full stack.
Pop/peek operation is requested on an empty stack.
Application using ADT Stack is not…
concerned with way storage stack is managed.