Topics
- Algorithms, properties of algorithms, time complexity and
space complexity, asymptotic behaviour of functions, analysis of
algorithms, main complexity classes. NB! Definitions of
relations: "big-O", "small-o", "Theta", big-Omega",
"small-omega".
- Searching and sorting. Linear search, binary search, hashing.
Insertion sort, binary insertion sort, quicksort, merge sort,
counting sort, radix sort, bucket sort. Complexity of different
methods (for all methods time complexity: average and worst
case, space complexity).
- Abstract data types. Stacks and queues. Reverse Polish
Notation (RPN). Linked lists and other pointer structures.
- Trees. Examples of trees - arithmetic expression tree.
Traversal of trees - preorder, postorder, in-order. Forms of
expression for trees - parenthetic expressions, pointer
structures, textual representation. Examples of "top-down" and
"bottom-up" traversal.
- Graphs. Directed and undirected graphs, multigraphs. Cyclic
and acyclic graphs. Connected components. Strongly
connected and weakly connected graphs. Paths and cycles.
Simple graphs. Matrices related to graphs: adjacency matrix,
matrix of shortest pathlengths. Operations on graphs: sum,
multiplication, transitive closure. Representation and
implementation of graphs. Algorithms on graphs: Floyd-Warshall
(lengths of shortest paths), topological sort of vertices,
depth-first and breadth-first traversal, Dijkstra (shortest
path), finding connected components, minimal spanning tree.
Complexities for all algorithms.
- Recursion: Hanoi tower, elimination of recursion, tail
recursion. Exhaustive search: 8 queens problem, knapsack
problem.
- Binary search trees, AVL trees, red-black trees, binomial
trees. B-trees. Heaps, heapsort. BST property and heap property.
- String algorithms: exact matching (linear, Knuth-Morris-Pratt,
Boyer-Moore, Rabin-Karp).
- Coding and compressing, coding schemes: Huffman, Shannon-Fano.
Greedy algoritms: Huffman encoding.
- Dynamic programming: longest common subsequence problem.
- Correctness of algorithms: preconditions, postconditions, loop
invariants, weakest precondition, structural rules, total
correctness and partial correctness, halting problem.
- Practical programming task: trees, recursion.