0% found this document useful (0 votes)
5 views2 pages

Algorithms Class Notes

The document covers key concepts in algorithms, including Time and Space Complexity, with examples of different complexities. It discusses problem-solving strategies like Divide and Conquer and Dynamic Programming, highlighting their applications and methods. Additionally, it lists common Graph Algorithms used for solving graph-related problems.

Uploaded by

Shagufta Anjum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Algorithms Class Notes

The document covers key concepts in algorithms, including Time and Space Complexity, with examples of different complexities. It discusses problem-solving strategies like Divide and Conquer and Dynamic Programming, highlighting their applications and methods. Additionally, it lists common Graph Algorithms used for solving graph-related problems.

Uploaded by

Shagufta Anjum
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Algorithms Class Notes

1. Time and Space Complexity

Time Complexity measures the amount of time an algorithm takes relative to the input size.

Examples:

- O(1): Constant time

- O(log n): Binary Search

- O(n): Linear Search

- O(n log n): Merge Sort

- O(n^2): Bubble Sort

Space Complexity refers to the amount of memory used by the algorithm during its execution.

2. Divide and Conquer

A problem-solving strategy that breaks a problem into subproblems of the same type, solves them

recursively, and combines their solutions.

Example: Merge Sort

- Divide: Split the array into two halves

- Conquer: Recursively sort each half

- Combine: Merge the sorted halves

3. Dynamic Programming

Used for optimization problems by breaking them into overlapping subproblems and storing results.

Key concepts:

- Memoization (Top-down)

- Tabulation (Bottom-up)
Algorithms Class Notes

Example: Fibonacci sequence, 0/1 Knapsack, Longest Common Subsequence

4. Graph Algorithms

Graph algorithms solve problems related to graphs (nodes and edges).

Common algorithms:

- BFS (Breadth-First Search)

- DFS (Depth-First Search)

- Dijkstra's Algorithm (Shortest Path)

- Kruskal's and Prim's Algorithm (Minimum Spanning Tree)

You might also like