Comprehensive Study Guide for Cumulative Exam
Topics Before Exam 1
Linear Search:
- Checks elements one by one, O(n) time.
- Use on unsorted data.
Binary Search:
- Requires sorted data, O(log n) time.
- Divide and conquer.
C Programming Review:
- Pointers: Variables storing memory addresses.
- Pass by Value vs. Reference: Reference uses pointers to modify original values.
- Strings: Character arrays ending in null terminator '\0'.
- File I/O: fopen, fscanf, fprintf, fclose for file manipulation.
- Structs: User-defined data types with multiple fields.
- Dynamic Memory: malloc, calloc, realloc for allocation; free to deallocate.
Big-O Notation:
- Describes time complexity.
- Common classes: O(1), O(log n), O(n), O(n log n), O(n²).
Summations:
- Arithmetic: sum = n(n+1)/2
- Geometric: sum = a(r^n - 1)/(r - 1)
Topics Between Exam 1 and 2
Algorithm Design:
- Optimize basic solutions; use sorted data, binary search.
Recursion:
Comprehensive Study Guide for Cumulative Exam
- Functions calling themselves.
- Must have base and recursive cases.
Recurrence Relations:
- Solve using iterative substitution, recursion trees, or Master Theorem.
- Analyze recursive algorithm complexity.
Linked Lists:
- Nodes point to next elements.
- Operations: insert, delete, search, traverse.
- Types: singly, doubly, circular.
Topics After Exam 2
Stacks:
- LIFO structure: push/pop.
- Use for backtracking, expression parsing.
Queues:
- FIFO structure: enqueue/dequeue.
- Used in BFS, job scheduling.
Trees:
- BST: ordered binary trees.
- AVL: balanced BSTs with rotations.
- Tries: prefix trees for strings.
- Heaps: Complete binary trees for priority queues.
Hash Tables:
- Key-value pairs, use hashing functions.
- Handle collisions via chaining or probing.
Comprehensive Study Guide for Cumulative Exam
Sorting Algorithms:
- Bubble, Insertion, Selection: O(n²), easy to implement.
- Merge Sort, Heap Sort, Quick Sort: O(n log n), efficient.
- Know best/worst cases and stability.
Study Tips
- Trace through code by hand, especially recursion and pointer manipulation.
- Write your own versions of algorithms and data structures.
- Use flashcards for time complexities and concepts.
- Practice visualizing memory and pointers.