Skip to content

mithleshprasad/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DSA


Data Structures and Algorithms (DSA) README

Introduction

  • Objective: Understand core concepts of data structures and algorithms to solve computational problems efficiently.
  • Pre-requisites: Basic understanding of a programming language and mathematical concepts like logarithms and modular arithmetic.

1. Basics of DSA

Topics:

  1. Time and Space Complexity

    • Big-O, Big-Θ, and Big-Ω Notations
    • Analyze iterative and recursive functions
  2. Mathematics for DSA

    • Modular Arithmetic
    • GCD (Euclid’s Algorithm)
    • Exponentiation (Power functions, Modular Exponentiation)

2. Arrays and Strings

Topics:

  1. Arrays:

    • Traversal, Insertion, Deletion
    • Prefix Sums, Sliding Window
    • Kadane’s Algorithm (Maximum Subarray Sum)
  2. Strings:

    • String Matching (KMP Algorithm, Rabin-Karp)
    • Anagrams, Palindromes
    • Z Algorithm

Practice:

  • Two Sum Problem
  • Longest Palindromic Substring

3. Linked Lists

Topics:

  1. Singly Linked List

    • Insertion, Deletion, Traversal
    • Detect Cycle (Floyd’s Cycle Detection)
  2. Doubly Linked List

  3. Circular Linked List

Practice:

  • Reverse a Linked List
  • Merge Two Sorted Linked Lists

4. Stacks and Queues

Topics:

  1. Stacks:

    • Next Greater Element
    • Evaluate Postfix/Prefix Expressions
  2. Queues:

    • Circular Queue
    • Deque (Double-Ended Queue)

Practice:

  • Implement Min Stack
  • Sliding Window Maximum

5. Trees

Topics:

  1. Binary Tree:

    • Traversals (Inorder, Preorder, Postorder)
    • Diameter of a Tree
    • Lowest Common Ancestor (LCA)
  2. Binary Search Tree (BST):

    • Insertion, Deletion, Search
    • Balanced BSTs (AVL Trees, Red-Black Trees)
  3. Heaps:

    • Min-Heap and Max-Heap
    • Heap Sort

Practice:

  • Convert Sorted Array to BST
  • Binary Tree Level Order Traversal

6. Graphs

Topics:

  1. Representations: Adjacency Matrix, Adjacency List

  2. Traversal Algorithms:

    • Depth First Search (DFS)
    • Breadth First Search (BFS)
  3. Shortest Path Algorithms:

    • Dijkstra's Algorithm
    • Bellman-Ford
  4. Minimum Spanning Tree (MST):

    • Kruskal’s Algorithm
    • Prim’s Algorithm
  5. Topological Sorting

Practice:

  • Detect Cycle in a Graph
  • Clone a Graph

7. Searching and Sorting Algorithms

Topics:

  1. Sorting:

    • Bubble, Selection, Insertion Sort
    • Quick Sort, Merge Sort, Heap Sort
  2. Searching:

    • Linear Search, Binary Search
    • Applications of Binary Search (First and Last Occurrence)

Practice:

  • Search in Rotated Sorted Array
  • Find Median in a Sorted Array

8. Recursion and Backtracking

Topics:

  1. Basics of Recursion

    • Factorial, Fibonacci, Power Functions
  2. Backtracking:

    • N-Queens Problem
    • Rat in a Maze
    • Subset Sum

Practice:

  • Generate Parentheses
  • Word Search in a Grid

9. Dynamic Programming (DP)

Topics:

  1. Basics:

    • Recursion to DP Transition
    • 0/1 Knapsack, Subset Sum
  2. Advanced DP:

    • Longest Common Subsequence (LCS)
    • Longest Increasing Subsequence (LIS)
    • Matrix Chain Multiplication

Practice:

  • Edit Distance
  • Minimum Path Sum

10. Advanced Data Structures

Topics:

  1. Tries:

    • Insert and Search
    • Longest Prefix Matching
  2. Segment Trees:

    • Range Queries
    • Lazy Propagation
  3. Fenwick Tree (Binary Indexed Tree)

Practice:

  • Count Inversions using BIT
  • Range Sum Queries

11. Bit Manipulation

Topics:

  1. Basics of Bits

    • AND, OR, XOR Operations
    • Bit Masking
  2. Applications:

    • Subset Generation
    • Count Set Bits

Practice:

  • Single Number Problem
  • Power of Two

12. Problem-Solving Strategies

Topics:

  1. Divide and Conquer
  2. Sliding Window Technique
  3. Two Pointers

Practice:

  • Maximum Product Subarray
  • Container with Most Water

Practice Platforms

  1. LeetCode
  2. GeeksforGeeks
  3. Codeforces
  4. HackerRank
  5. CodeChef

Learning Tips

  1. Start small: Solve basic problems before tackling harder ones.
  2. Debug efficiently: Use print statements or debugging tools to trace your logic.
  3. Consistency: Practice daily to build strong problem-solving skills.

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •