Topic 5 of 6 · Form 5
Algorithm design and data structures
Abstraction, decomposition, pattern recognition; structured English, flowcharts, pseudocode; stepwise refinement.
Notes for this topic 1 file, in order
Create a free account to download PDFs.
Computational thinking
Abstraction, decomposition, pattern recognition; structured English, flowcharts, pseudocode; stepwise refinement.
Data types and structures
Records, 1D and 2D arrays, files; abstract data types: stacks (LIFO), queues (FIFO, circular), linked lists (nodes and pointers), binary trees, hash tables, dictionaries.
Algorithms
Linear and binary search; bubble and insertion sort; algorithms on ADTs (insert, delete, find, traverse); recursion (base case, general case, call stack); Big O notation for time and space complexity.
Worked example: Write a recursive function for the sum of 1 to n.
FUNCTION Sum(n : INTEGER) RETURNS INTEGER
IF n = 1 THEN
RETURN 1
ELSE
RETURN n + Sum(n − 1)
ENDIF
ENDFUNCTION
Further algorithms
Graph representation; Dijkstra's shortest path and A* search (introduction); binary search tree traversal (pre-, in-, post-order).
Check yourself
- State the time complexity of binary search.
- Which tree traversal outputs a binary search tree in ascending order?
- What is a base case in recursion?
Show answers
- O(log n)
- In-order traversal.
- The condition that stops recursion and returns a value without further calls.
Questions about this topic (0)
No questions about this topic yet.
Sign in or create a free account to join in.