2.3.1 - Algorithms Flashcards
Stack data structure: concept and application
LIFO
Web address stacks
Stack memory (Call stack)
Queue data structure: concept and application
FIFO
Printing queues
Multi-level feedback queues
Binary tree data structure: concept and application
Root at the top - branches as links - leaves as last nodes
Folder structures (Hierarchical data)
Manipulating sorted lists
Linked lists: concept and application
dynamic data structure
non-contiguous memory allocation
each node holds a pointer to the next
Symbol table creation
linked allocation of files
Name and explain all traversal algorithms
Pre-order/depth-first = data, left, right
in-order = left, data, right
post-order = left, right, data
breadth first = visit each neighbour using queue
Two rules of Big o notation
- Remove all terms except the one with the largest factor or exponent
- Remove any constants
Explain O(1) notation
Constant complexity
Executes the same amount of time regardless of inputs
Explain O(log n)
Logarithmic
Halves the data in each path
Opposite to exponential
Explain O(n) notation
Linear complexity
Performance declines as data set grows
Explain O(n^2) notation
Polynomial complexity
Performance is proportional to the square of the size of the data set
(Nested iterations)
Explain O(2^N) notation
Exponential complexity
Doubles with each addition to the data set
Opposite to logarithmic