Skip to content
VUBuddy

CS502 Highlighted Handouts by VUBuddy

Fundamentals of Algorithms PDF 1.5 MBUpdated 23 Oct 2026
Highlighted handout CS502 Highlighted Handouts by VUBuddy PDF 1.5 MB
vubuddy.com
Type
Highlighted handout
Course
CS502 Fundamentals of Algorithms
Size
PDF 1.5 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 1.5 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 3, 4, 5 of 184. Download the file for all 184 pages.

Contents

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5 Course in Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  6. 6 Analyzing Algorithms
  7. 7 Model of Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  8. 8 Example: 2-dimension maxima . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9. 9 Brute-Force Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  10. 10 Running Time Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  11. 10.1 Analysis of the brute-force maxima algorithm.
  12. 11 Analysis: A Harder Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  13. 11.1 2-dimension Maxima Revisited
  14. 11.2 Plane-sweep Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  15. 11.3 Analysis of Plane-sweep Algorithm . . . . . . . . . . . . . . . . . . . . . . . . .
  16. 11.4 Comparison of Brute-force and Plane sweep algorithms

Asymptotic Notation

Divide and Conquer Strategy

  1. 1 Merge Sort
  2. 1.1 Analysis of Merge Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  3. 1.2 The Iteration Method for Solving Recurrence Relations . . . . . . . . . . . . . . .
  4. 1.3 Visualizing Recurrences Using the Recursion Tree . . . . . . . . . . . . . . . . . CONTENTS
  5. 1.4 A Messier Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  6. 2 Selection Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  7. 2.1 Sieve Technique
  8. 2.2 Applying the Sieve to Selection
  9. 2.3 Selection Algorithm
  10. 2.4 Analysis of Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sorting

  1. 1 Slow Sorting Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  2. 2 Sorting in O(n log n) time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  3. 2.1 Heaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  4. 2.2 Heapsort Algorithm
  5. 2.3 Heapify Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  6. 2.4 Analysis of Heapify
  7. 2.5 BuildHeap
  8. 2.6 Analysis of BuildHeap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  9. 2.7 Analysis of Heapsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  10. 3 Quicksort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  11. 3.1 Partition Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  12. 3.2 Quick Sort Example
  13. 3.3 Analysis of Quicksort
  14. 3.4 Worst Case Analysis of Quick Sort
  15. 3.5 Average-case Analysis of Quicksort . . . . . . . . . . . . . . . . . . . . . . . . .
  16. 4 In-place, Stable Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  17. 5 Lower Bounds for Sorting

Linear Time Sorting

  1. 1 Counting Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  2. 2 Bucket or Bin Sort
  3. 3 Radix Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  4. 1 Fibonacci Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS

  1. 2
  2. 3 Edit Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  3. 3.1 Edit Distance: Applications
  4. 3.2 Edit Distance Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  5. 3.3 Edit Distance: Dynamic Programming Algorithm . . . . . . . . . . . . . . . . . .
  6. 3.4 Analysis of DP Edit Distance
  7. 4 Chain Matrix Multiply
  8. 4.1 Chain Matrix Multiplication-Dynamic Programming Formulation . . . . . . . . .
  9. 5 0/1 Knapsack Problem
  10. 5.1 0/1 Knapsack Problem: Dynamic Programming Approach . . . . . . . . . . . . .

Greedy Algorithms

  1. 1 Example: Counting Money . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  2. 1.1 Making Change: Dynamic Programming Solution
  3. 1.2 Complexity of Coin Change Algorithm . . . . . . . . . . . . . . . . . . . . . . .
  4. 2 Greedy Algorithm: Huffman Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  5. 2.1 Huffman Encoding Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
  6. 2.2 Huffman Encoding: Correctness . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
  7. 3 Activity Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
  8. 3.1 Correctness of Greedy Activity Selection . . . . . . . . . . . . . . . . . . . . . . 107
  9. 4 Fractional Knapsack Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

Graphs

  1. 1 Graph Traversal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
  2. 1.1 Breadth-first Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
  3. 1.2 Depth-first Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
  4. 1.3 Generic Graph Traversal Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 119
  5. 1.4 DFS - Timestamp Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
  6. 1.5 DFS - Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
  7. 2 Precedence Constraint Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
  8. 3 Topological Sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
  9. 4 Strong Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
  10. 4.1 Strong Components and DFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
All CS502 files →
CS502 Fundamentals of Algorithms All CS502 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.