These notes cover the full Design and Analysis of Algorithms course for BCA Semester IV in four units. Each unit is split into short topics that take about 10 to 20 minutes to read, with worked examples, common mistakes and practice questions with answers.

What you will be able to do

Unit I: Analysis of Algorithms and Recursion

  • Define an algorithm and state its properties and the criteria for judging it.
  • Compute time and space complexity by counting basic operations.
  • Use O, Ω and Θ notation and compare growth rates of functions.
  • Analyse sequential search, bubble, selection and insertion sort and matrix multiplication.
  • Write and solve recurrences for recursive algorithms.
  • Apply the Master theorem to divide and conquer recurrences.

Unit II: Divide and Conquer and the Greedy Technique

  • Explain the general divide and conquer method and write its recurrence.
  • Analyse binary search, finding maximum and minimum, merge sort and quick sort.
  • Multiply matrices using Strassen's method and state its complexity.
  • Prove the n log n lower bound for comparison-based sorting.
  • Explain the greedy method and solve the fractional knapsack problem.
  • Apply Prim's, Kruskal's and Dijkstra's algorithms and analyse them.

Unit III: Dynamic Programming and Graph Algorithms

  • Explain dynamic programming and when it applies.
  • Compute Fibonacci numbers and binomial coefficients by tabulation.
  • Apply the Floyd-Warshall algorithm to find all-pairs shortest paths.
  • Solve the 0/1 knapsack problem with a dynamic programming table.
  • Perform breadth first and depth first search and analyse them.
  • Find connected components and a topological ordering of a directed acyclic graph.

Unit IV: Backtracking and Computational Intractability

  • Explain the limits of algorithmic power and the idea of backtracking.
  • Solve the n-Queen problem by backtracking and state its complexity.
  • Solve sum of subsets using a state-space tree with pruning.
  • Find Hamiltonian circuits and vertex covers and explain their difficulty.
  • Explain non-deterministic algorithms and the classes P and NP.
  • Distinguish NP-complete from NP-hard problems and describe reductions.

Who this is for

BCA Semester IV students studying Design and Analysis of Algorithms (course code 26BCA404DS03), and anyone who wants a plain-English walk through the same syllabus. Start at Unit I unless you already know the basics.

Syllabus

Unit I: Analysis of Algorithms and Recursion

Topic Time
Algorithms, Design and Performance Analysis 5 min
Asymptotic Notations 5 min
Analysis of Sequential Search and Sorting Algorithms 5 min
Analysis of Matrix Multiplication 5 min
Recursion and the Analysis of Recursive Algorithms 5 min
The Master Theorem 5 min
Unit I review: summary, glossary and questions 10 min

Unit II: Divide and Conquer and the Greedy Technique

Topic Time
Divide and Conquer: General Concept, Binary Search, Maximum and Minimum 5 min
Merge Sort 5 min
Quick Sort 5 min
Strassen's Matrix Multiplication 5 min
Lower Bound for Comparison-Based Sorting 5 min
The Greedy Technique and the Knapsack Problem 5 min
Minimum Spanning Trees: Prim's and Kruskal's Algorithms 5 min
Dijkstra's Algorithm for Single-Source Shortest Paths 5 min
Unit II review: summary, glossary and questions 10 min

Unit III: Dynamic Programming and Graph Algorithms

Topic Time
Dynamic Programming: The General Concept and Fibonacci Numbers 5 min
Binomial Coefficients 5 min
All-Pairs Shortest Paths: Floyd-Warshall Algorithm 5 min
The 0/1 Knapsack Problem 5 min
Graph Traversal: Breadth First Search 5 min
Depth First Search and Connected Components 5 min
DFS of a Directed Graph and Topological Sorting 5 min
Unit III review: summary, glossary and questions 10 min

Unit IV: Backtracking and Computational Intractability

Topic Time
Limitations of Algorithmic Power and the Backtracking Method 5 min
The n-Queen Problem 5 min
The Sum of Subsets Problem 5 min
Hamiltonian Circuit and Vertex Cover 5 min
Non-Deterministic Algorithms, P and NP 5 min
NP-Complete and NP-Hard Problems 5 min
Unit IV review: summary, glossary and questions 10 min

How to study these notes

  1. Read one topic per sitting and try each worked example on paper before reading the solution.
  2. Answer the practice questions first, then check the answers at the end of the topic.
  3. Finish each unit with its review page and the question bank.

Sources

  • Official BCA syllabus Design and Analysis of Algorithms, course code 26BCA404DS03