DSA-Guide icon indicating copy to clipboard operation
DSA-Guide copied to clipboard

Building Ultimate Data Structure and Algorithms in C++ Solution Repository. Solution to various DSA problems including problem from Leetcode, Codechef, GFG, Coding Ninjas.

DSA-Cpp

wakatime

Contributors are invited to improve the content, add new problems to it.

Arrays

  • Array

  • Character Arrays

    2D Matrix Multiplication
  • 2D Input

  • 2D Matrix Multiplication

  • 2D Matrix Search

Questions

  • 2D Input
  • 2D Input 1
  • Continuous Subarray Sum Multiple K
  • Find Pivot Element
  • Frequency of Each Element in Sorted Array
  • Remove Duplicates from Sorted Array
  • Sudoku Solver
  • Longest Arithmetic Array
  • Max Till i
  • Minimum Element
  • Record Breaking
  • Reverse an Array
  • Rotation Game
  • Spiral Traversal 2D
  • Sum of Subarrays

Questions by Top MNCS's

  • Sorting Array Algorithm

  • Sorting Array Algorithm

  • Circular Max Sum Subarray

  • First Repeating Element

  • Matrix Transpose

  • Maximum Subarray Sum

  • Pair Sum Problem

  • Print Subarrays

  • Smallest Positive Missing Number

  • Subarray with Given Sum

    Sorting Array Algorithm

  • Question Statement

  • Solution

Searching

  • Linear Search

Sorting

Decreasing

  • Bubble Sort
  • Insertion Sort
  • Selection Sort

Questions

  • Count Inversion

Other Sorting Algorithms

  • Bubble Sort
  • Count Sort
  • DNF Sort
  • Insertion Sort
  • Merge Sort
  • Quick Sort
  • Selection Sort
  • Wave Sort

Backtracking

  • Letter Combination
  • N Queen Problem
  • Rat in a Maze
  • Sudoku Solver

Binary Search

  • Binary Search
  • Lower Bound
  • Upper Bound
  • Using STL

Questions

  • 2 Power K

  • Bitonic Array

  • Count of Element in a Sorted Array

  • Index of First 1 Infinite

  • Min Diff Element

  • Number of Times Sorted Array Rotated

  • Painters Partition Problem

  • Search in 2D

  • Search in Infinite Array

  • Searching in Nearly Sorted Array

  • Book Allocation Problem

  • Find Peak

  • First and Last Occurence

  • Search on Reverse Sorted Array

    Element Search in Rotated Sorted Array

  • README.md

  • Code

Binary Tree

  • Tree.cpp

Form Binary Tree

  • PostInOrder.cpp
  • PreInOrder.cpp

Questions

  • BT Tilt.cpp

  • Balanced Height BT.cpp

  • Boundary Traversal.cpp

  • Check Sum Tree.cpp

  • Clone BT with Random Pointer.cpp

  • Compare Two Binary Tress.cpp

  • Count Sum Nodes.cpp

  • Diameter of BT.cpp

  • IsSymmetry.cpp

  • K Sum Paths.cpp

  • Kth Ancestor.cpp

  • Lowest Common ancestor.cpp

  • Lowest Common ancestor II.cpp

  • Max Height.cpp

  • Max Path Sum.cpp

  • Max Sum Path.cpp

  • Max Sum of Non Adjacent.cpp

  • Nodes at Distance K.cpp

  • Populating Right Next.cpp

  • Shortest Distance Bw Two Nodes.cpp

  • Sum Replacement.cpp

    Flatten A Binary Tree to Linked List

  • Flatten A Binary Tree.cpp

  • Flatten A Binary Tree 2.cpp

    Longest ZigZag Path in a Binary Tree

  • README.md

  • Code.cpp

    Maximum Width of Binary Tree

  • README.md

  • Code.cpp

    Burn Tree

  • Burn Tree.cpp

Traversals of Binary Tree

  • Bottom View BT.cpp

  • Left View BT.cpp

  • Morris Traversal.cpp

  • Right View BT.cpp

  • Top View BT.cpp

  • Vertical Traversal.cpp

  • Zig Zag Traversal.cpp

  • Traversal.cpp

    Level Order Traversal

  • Bottom to Top.cpp

  • Top to Bottom.cpp