Skip to content

πŸš€ DSA Repository in C++ – A structured collection of Data Structures & Algorithms with topic-wise problems, solutions, and links to LeetCode, GFG, and InterviewBit. Perfect for competitive programming and interview prep! πŸ“šπŸ’»

Notifications You must be signed in to change notification settings

Jashans254/DSA_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

36 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Ultimate DSA Repository for Coding Interviews πŸ’»

This repository contains Data Structures and Algorithms (DSA) problems solved in C++, sourced from LeetCode, GeeksforGeeks, and InterviewBit.
Ideal for competitive programming, coding interviews, and DSA mastery.

  • It tracks all the code and problem statement from the free DSA course at youtube by Coder Army via Rohit Negi
  • Advanced topics Like DP are covered from Take u forward by Striver

Key Features:

  • βœ… 100+ Handpicked Questions
  • βœ… Topic-wise Categorization
  • βœ… Solutions with Explanations
  • βœ… Updated regulary.
  • βœ… More than one approach to each problems

alt text Example for easy navigation : purple arrow pointing to "Size of Binary Tree" which when clicked , opens the solution of the problem. Yellow arrow indicates "platform name" , which on clicking ; navigates you to the problem statement tab.

Table of Contents

  1. Basic DSA /Math
  2. Basic Array Problems
  3. Sorting Algorithms
  4. Binary Search
  5. Matrix Problems
  6. Strings
  7. STL
  8. Pointers
  9. Recursion
  10. OOPS
  11. Linked List
  12. Stack
  13. Queue
  14. Binary Tree
  15. Graph
  16. Heap
  17. Dynamic Programming

Basic DSA /Math Problems

$1$ ArmStrongNO ; $2$ BishopMoves:- IB ; $3$ bitDiff:-gfg $4$ ComplimentNo:-LC ; $5$ DistributeCircle:-IB ; $6$ NimGame:-LC ; $7$ AddDigits:-LC ; $8$ LeapYear:-gfg ; $9$ RevInt:-gfg ; $10$ PowerOf2:- LC ; $11$ PalandromeNo:-LC ; $12$ CheckRectangle:- IB ; $13$ SetBits:-gfg ; $14$ NbyNChessBoard:- gfg ; $15$ Sqrt:- LC ; $16$ TotalSetBits:- gfg ; $17$ TralingZeroesFact:- gfg ; $18$ uglyNo:- LC

Basic Array Problems

This section covers fundamental problems related to arrays.

  1. P1 Program showing basic input and output of an array

  2. Problem2 Program to get minimum element in the array

  3. P3 Program to get minimum element in the array

  4. P4 Linear Search in 1-D array

  5. P5 Reverse array :-1)using S.C.-O(n) 2) S.C.-O(1) two pointer approach

  6. P6 Program to get second Max in an array. GfG link

  7. P7 store fibonaci series :- 0,1,1,2,3,5,8,13.... in an array

  8. P8 Rotate array by 1 GfG link

  9. P9 Missing no GfG link

  10. P10 Smallest Postive Missing no GfG link

  11. P11 Move all negative elements to end GfG link

  12. P12 Count number of elements between two given elements in array GfG link

Sorting Algorithms

This section includes various sorting algorithms.

  1. Selection Sort

Binary Search

Matrix Problems

This section focuses on problems related to 2-D array.

Strings

  1. BasicOperations
  2. DefangIpAdd :- LeetCode ; rotateby2 :- gfg ; Pangram :- leetcode ; sort:-gfg
  3. LongestPalandrone :- leetcode ; sortSentence :- leetcode
  4. sortVowels :- leetcode ; AddString :- leetcode ; CaseSort:-gfg
  5. FactOfLargeNo :- gfg ; RomanToInt :- leetcode ; IntToRoman :- RomanToInt :- Leetcode
  6. Sliding Window :- LongestSubstrWithoutRepeatChar :- Leetcode ; SmallestDistinctWindow :- gfg ; Smallest_window_0_1_2 :-gfg ; Longest_K_UniquecharSubstring :-gfg
  7. KMP Algorithm :- LargestPrefixSuffix :- gfg ; IndexFirstOccurranceString :- Leetcode ; Search_Pattern :-gfg
  8. String Hard Problems ; MinCharsMakePallindrone :- gfg ; RepeatedStringMatch:- Leetcode ; MinAppendPalindrome :- IB ; SHortestPallindrome :- Leetcode

STL

This section focuses on standard template library

Pointers

This section focuses on pointers

  1. Lec1 Basics about pointers
  2. Lec2 pointer with array and pointer arthimetic
  3. Lec3 pointers with char array , function calls , length & palandrone string
  4. Lec4 double pointers - 7 problems ; copying str
  5. Lec4_hw lower to upper ,reverse a string , concatenate :-strings & update ,swap values
  6. Lec5 Memory Management in 1-D array
  7. Lec6 2-D , 3-D , 4-D Array Memory Allocation and Deallocation

Recursion

All about function calling itslef repeatedly untill base condition.

  1. lec1 iterative vs mutliple function vs recursion ;printNto1(5);printOddNto1(10);printEvenNto1(10);printName("Helloji");

  2. lec2 one vs two arguments ; print1toN(10);print10toN(11);tableN(2);

  3. lec3 factorial ; sumN ; powerof2 ;sumSqNno ; powerof4 ; leetcode

  4. Lec4 primeno ; SumNcubes

  5. Lec5 Count No of hops :-gfg ; fibonacci :- Leetcode ; GCD :- gfg ; Nth stair :- leetcode ; Print N fibonacci nos :- GFG

  6. lec6 printArray ( 3 approaches) ; sum (2 approach) , evensum, product , min , max

  7. lec7 CheckPal :-gfg ; CheckVowels ; CountConsonants ; RevStr :-gfg ; toUpper :-gfg ; toLwr :- gfg

  8. lec8_Binary_Search

  9. lec9_TC_SC

  10. lec10_mergesort :- LeetCode

  11. QuickSort

  12. Recursion_on_Subsquence : - LeetCode ; subset_string.cpp ; generateParenthesis :- LeetCode ; sumsubsequence , alternative:- gfg

  13. printalong ; TargetSum

  14. PerfectSum :-gfg ; repeattargetsum ; hw

  15. Permutation :- leetcode ; PermutationString :- gfg

  16. PermII :- Leetcode ; waysToN :- gfg ; hw

  17. Tower_Of_Hanoi :- gfg

Object Oriented Programming

All about objects and classes

  1. lec1 object vs function approach ; class & obj ; padding ; static vs dynamic allocation
  2. lec2 constructor & destructor
  3. lec3 static data member
  4. lec4 inheritence ,access modifier
  5. lec5 types of inheritence
  6. lec6:- Polymorphism ; function Overloading; Opertor Overloading ; Virtual function
  7. lec7:- Exception Handling ; Basic ; DIvBy0 ; StdException
  8. lec8 File handling in cpp

Linked List

Stack

Binary Tree

Graph

Heap

Dynamic Programming

Introduction to DP

1-D DP

2-D DP / Grid

DP on subsequences

DP on strings

DP on Stocks

  • Best Time to Buy and Sell Stock |(DP-35) DP :- LC

DP on Squrares

SDE Sheet

Arrays

Arrays 2

Array 3

YouTube Channel

Check out the accompanying YouTube channel for video explanations and tutorials: Coder Army

Contributing

Feel free to contribute by adding new problems, improving existing solutions, or suggesting enhancements. Follow the contribution guidelines for more details.

License

This project is licensed under the MIT License.

About

πŸš€ DSA Repository in C++ – A structured collection of Data Structures & Algorithms with topic-wise problems, solutions, and links to LeetCode, GFG, and InterviewBit. Perfect for competitive programming and interview prep! πŸ“šπŸ’»

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages