CS_Topics_Notes
CS_Topics_Notes
1. Mathematical Induction
Mathematical induction is a proof technique used to prove statements that are assumed to be true for all natural
numbers.
1. Base Case: Verify the statement for the first value (usually n=1).
2. Inductive Step: Assume the statement is true for n=k and prove it for n=k+1.
Example: Prove that the sum of cubes of three consecutive natural numbers is divisible by 9.
2. Asymptotic Analysis
Asymptotic analysis helps evaluate the efficiency of algorithms by expressing their time or space complexity in terms of
3. Recurrence Relations
- Recursion Tree: A visual method to solve recurrence by breaking down the recurrence at each level.
4. Pseudocode Writing
Examples include writing pseudocode for multiplication using addition, exponentiation using recursion, and selection
sort.
A heap is a specialized tree-based data structure that satisfies the heap property.
- Binary Heap: Can be a max-heap or min-heap.
6. Sorting Algorithms
Stable sorting algorithms like merge-sort and bubble-sort maintain relative order of equal elements.
Recursive versions of sorting algorithms, like selection sort, can also be implemented.
7. Graph Algorithms
8. Union-Find Structure
9. Huffman Coding
Huffman coding is a compression algorithm used to encode data with variable-length codes.
Examples include activity scheduling, interval selection, and various priority-based optimizations.