NotesBCADesign and Analysis of Algorithm
UGCC2519

Design and Analysis of Algorithm Notes

Program:BCA
Semester:Semester 4
Credits:3
Units:4 Units

Subject Overview

Design and Analysis of Algorithm formalizes algorithmic problem-solving — time/space complexity and asymptotic notation, the Divide & Conquer technique (binary search, merge/quick sort, Strassen's matrix multiplication), the Greedy technique (Knapsack, Prim's/Kruskal's/Dijkstra's algorithms), and Dynamic Programming (Fibonacci, Floyd-Warshall, 0/1 Knapsack) plus graph algorithms. A 3-credit core theory paper.

Unit-wise Syllabus

4 units — open any unit for detailed topic-wise notes, diagrams and important exam questions

  • Design and performance analysis of algorithms
  • time and space complexity
  • asymptotic notations (O, Ω, Θ)
  • analysis of sequential search/bubble sort/selection sort/insertion sort/matrix multiplication
  • recursion basics
  • analysis of recursive algorithms
  • Master's theorem
Key formulasMaster's theorem: T(n) = aT(n/b) + f(n)
  • Case 1

    f(n) smaller than n^(log_b a) → T(n) = Θ(n^(log_b a))

  • Case 2

    f(n) equal to n^(log_b a) → T(n) = Θ(n^(log_b a) log n)

  • Case 3

    f(n) larger → T(n) = Θ(f(n))

  • Merge sort example

    T(n) = 2T(n/2) + n → Θ(n log n)

Study guide

Before designing an algorithm you must be able to judge it. You learn performance analysis, time and space complexity, asymptotic notations (O, Ω, Θ), analysis of searching and sorting algorithms and matrix multiplication, recursion and recurrence analysis with the Master's theorem. Practise solving recurrences with the Master's theorem; it is a guaranteed numerical question.

Read Unit 1 notes
  • General concept
  • binary search
  • finding maximum and minimum
  • merge sort
  • quick sort
  • best/worst case analysis
  • Strassen's matrix multiplication
  • lower bound for comparison-based sorting
ProcessDivide and conquer
  1. 1Divide

    Split the problem into smaller parts

  2. 2Conquer

    Solve each part recursively

  3. 3Combine

    Merge the partial solutions

Study guide

Divide and conquer breaks a problem into smaller parts, solves each and combines the results. You study binary search, finding maximum and minimum, merge sort, quick sort with best and worst cases, Strassen's matrix multiplication and the lower bound for comparison-based sorting. Write the recurrence for each algorithm and solve it.

Read Unit 2 notes
  • General concept
  • general Knapsack problem
  • minimum weight spanning trees via Prim's and Kruskal's algorithms
  • Dijkstra's algorithm for single-source shortest paths
ComparisonPrim's vs Kruskal's
Prim's
Kruskal's

Builds

One growing tree from a start vertex

A forest that merges into a tree

Picks

Cheapest edge leaving the tree

Cheapest edge that forms no cycle

Best for

Dense graphs

Sparse graphs

Key structure

Priority queue

Union-find

Study guide

A greedy algorithm makes the best local choice at each step. You study the general idea, the fractional knapsack problem, minimum spanning trees using Prim's and Kruskal's algorithms and Dijkstra's single-source shortest paths. Trace Prim's and Kruskal's on the same graph and compare the steps.

Read Unit 3 notes
  • General concept
  • Fibonacci series and binomial coefficient computation
  • all-pairs shortest paths (Floyd-Warshall)
  • 0/1 Knapsack problem
  • finding connected components
  • topological sorting
ComparisonGreedy vs dynamic programming
Greedy
Dynamic programming

Decision

Best local choice, never revisited

Considers all subproblems

Optimal

Not always

Always, when the problem fits

Memory

Low

Stores a table of results

Example

Fractional knapsack

0/1 knapsack, Floyd-Warshall

Study guide

Dynamic programming solves overlapping subproblems once and stores the answers. You study Fibonacci numbers and binomial coefficients, all-pairs shortest paths (Floyd-Warshall), the 0/1 knapsack problem, connected components and topological sorting. Fill the DP table by hand for the knapsack problem; it shows exactly how the idea works.

Read Unit 4 notes

Why Design and Analysis of Algorithm Matters

Algorithm design is the heart of computer science and the main topic of coding interviews at top technology companies. Understanding complexity and the standard paradigms lets you solve unfamiliar problems instead of memorising solutions.

How to Prepare for Design and Analysis of Algorithm

  • Learn each technique with its standard example problems and complexities.
  • Practise recurrence solving and Master's theorem problems daily.
  • Compare greedy and dynamic programming on the knapsack problem to see when greedy fails.
  • Solve at least one coding problem on each technique every week.

Design and Analysis of Algorithm: Frequently Asked Questions

What is the difference between greedy and dynamic programming?

A greedy algorithm commits to the best local choice at each step and never reconsiders, while dynamic programming considers all subproblems and stores results to guarantee an optimal answer.

Why is the Master's theorem useful?

It gives the time complexity of many divide-and-conquer recurrences quickly without expanding them step by step.

Want the Complete Notes & Past Papers?

WhatsApp us and we'll send you the full notes, question banks, and previous year papers for Design and Analysis of Algorithm.