19 Computational thinking and problem-solving - Cambridge AS & A Level Class 12 Computer Science Notes, Diagrams and Solved Questions
Linear and binary search, insertion and bubble sort, implementing stacks, queues, linked lists, binary trees and dictionaries, the graph ADT, comparing algorithms with Big O notation, and writing and tracing recursive algorithms with the call stack.
In this chapter
Linear and binary search, the conditions for binary search and how performance varies with n
Insertion sort and bubble sort, and how initial order and n affect performance
Implementing a stack and a circular queue in an array
Finding, inserting and deleting items in a linked list with a free list
Inserting into and searching a binary search tree, and in-order traversal
Dictionaries built from arrays, and the graph as an ADT
Big O notation for time and space complexity
Recursion: base case, general case, tracing, the call stack and unwinding