Stacks
- Last in First out
- Only top item is accessible
- Undo, recursion, matching brackets
- Push(add to top), Pop(get top), peek(see top), (is)empty, (is)full
- ADT
- Fixed bottom
- Pointer value for top
- Big O
- Pop O(1) Push O(1) Peek O(1)
Queue
Assessment
- 25% CBT (5 short, 20 multi)
- 75% Exam
- Weekly formative quizzes on moodle
- Collection of elements
- et of associations or relationships
- Input and output data and query object
- Do not care what happens inside
- Cannot directly access the data inside
- Uses getters and setters
- High level decodeion vs concrete decodeion
- Focus on what is can do vs focus on how it manages it
- Independent implementation vs dependant implementation
- Unique predecessor and unique successor
- Lists, queues stacks
- Unique predecessor and many successors
- Trees
- Many predecessors and many successors
- Mesh, web, network
- No order hence no predecessors and no successors
- Group of people
- Analyse the problem
- Determine the basic operations
- Pick the data structure