Skip to content

aditya-2703/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Topics


patterns
PATTERN
math
MATHS
bit magic
BIT MAGIC
array
ARRAY
string
STRING
matrix
MATRIX
sorting
SORTING
SEARCHING
SEARCHING
hashing
HASHING
stack
STACK
queue
QUEUE
linked list
LINKED LIST
recursion
RECURSION
backtracking
BACKTRACKING
tree
TREE
trie
TRIE

PATTERNS

Qn Solution Qn Solution
1.PY 1.PY 18.PY 18.PY
2.PY 2.PY 19.PY 19.PY
3.PY 3.PY 20.PY 20.PY
4.PY 4.PY 21.PY 21.PY
5.PY 5.PY 22.PY 22.PY
6.PY 6.PY 23.PY 23.PY
7.PY 7.PY 24.PY 24.PY
8.PY 8.PY 25.PY 25.PY
9.PY 9.PY 26.PY 26.PY
10.PY 10.PY 27.PY 27.PY
11.PY 11.PY 28.PY 28.PY
12.PY 12.PY 29.PY 29.PY
13.PY 13.PY 30.PY 30.PY
14.PY 14.PY 31.PY 31.PY
15.PY 15.PY 32.PY 32.PY
16.PY 16.PY 33.PY 33.PY
17.PY 17.PY 34.PY 34.PY
35.PY 35.PY 36.PY 36.PY

MATH

Problems Solution Platform
ABSOLUTE VALUE Solution
ADDITION UNDER MODULE Solution GFG
CELCUISE TO FERENHITE Solution GFG
DIGIT COUNT PROBLEM Solution GFG
DIGIT IN FACTORIAL Solution GFG
EXACTLY THREE DEVISOR Solution GFG
FIND FACOTRIAL Solution GFG
FIND FIBONACCI Solution GFG
FIND GP TURM Solution GFG
FIND LCM Solution GFG
MOD MUL INVERSE Solution GFG
PRIME NUMBER Solution GFG

ARRAY

Problems Solution Platform
ARRANGE ARRAY IN O(1) Solution
ARRAY N ROTATION Solution LEETCODE
FIND EQUILIBRIAM POINT Solution GFG
FIND IMMIDIATE SMALLER Solution GFG
FIND TRANSITION POINT Solution GFG
FIND REPEATING ELEMENT Solution GFG
LEADER IN ARRAY Solution GFG
MERGE WITHOUT EXTRA SPACE Solution GFG
REMOVE DUPLICATE Solution LEETCODE
REVERSE ARRAY IN GROUP Solution GFG
SUBARRAY WITH GIVEN SUM Solution GFG
TRAPPING RAIN WATER Solution LEETCODE
WAVE ARRAY Solution GFG
WHO HAS A MAJORITY Solution GFG
DUPLICATE ZEROS Solution LEETCODE
DELETE ITEM FROM ARRAY Solution LEETCODE
NO OF GOOD PARIS Solution LEETCODE
TWO NUM SUM Solution LEETCODE
SMALLEST DIFFERENCE Solution GFG
MEJORITY ELEMENT N/2 PROBLEM Solution LEETCODE
LONGEST PEAK Solution LEETCODE
SUM OF ALL ODD LENGTH SUBARRAY Solution LEETCODE

STRING

Problems Solution Platform
ANAGRAM Solution LEETCODE
BINARY CHECK Solution GFG
CONVERT TO ROMAN Solution GFG
ISOMORPHIC Solution LEETCODE
KMP SOLUTION Solution GFG
LONGEST SUBSTRING WITHOUT REPEATING CHARACTER Solution LEETCODE
NAIVE SOLUTION Solution GFG
REVERSE WORD Solution GFG
SUM LARGE INT Solution GFG
VALIDATE IP Solution GFG

STACK

Problems Solution Platform
STACK Solution
STACK USING LINKED LIST Solution GFG
MAXIMUM RECTANGULAR AREA IN HISTOGRAM Solution LEETCODE
NEXT GREATER ELEMENT Solution GFG
PARANTHESIS CHECKER Solution LEETCODE
REVERSE A STRING USING STACK Solution GFG
REVERSE A STACK USING RECURSION Solution GFG
EVALUATION OF POSTFIX EXPRESSION Solution GFG
INFIX TO POSTFIX Solution GFG
REMOVE OUTERMOST PARANTHESIS Solution LEETCODE
DUPLICATE PARANTHESIS Solution GFG
EASY STRING Solution GFG
MIN STACK O(N) SPACE Solution LEETCODE
MIN STACK O(1) SPACE Solution LEETCODE
SLIDING WINDOW MAXIMUM Solution LEETCODE
STOCK SPAN PROBLEM Solution LEETCODE

QUEUE

Problems Solution Platform
QUEUE Solution
QUEUE WITH LINKED LIST Solution GFG
CIRCULAR QUEUE Solution GFG
PRIORITY QUEUE Solution GFG
DOUBLE ENDED QUEUE Solution GFG
SLIDING WINDOW MAXIMUM Solution GFG

MATRIX

Problems Solution Platform
ADDITION OF TWO MATRIX Solution GFG
BOOLEAN MATRIX Solution GFG
DETERMINATION OF TWO MATRIX Solution GFG
MAX SUM OF 1'S Solution.PY GFG
MULTIPLICATION OF TWO MATRIX Solution GFG
ROTATE MATRIX 90 DEGREE Solution GFG
SEARCH IN MATRIX Solution LEETCODE
SPIRAL TRAVERSAL IN MATRIX Solution LEETCODE
TRANSPOSE OF MATRIX Solution GFG

LINKED LIST

Problems Solution Platform
LINKED LIST Solution GFG
DOUBLY LINKED LIST Solution GFG
CIRCULAR LINKED LIST Solution GFG
CIRCULAR DOUBLY LINKED LIST Solution GFG
DELETE ALTERNATE NODE IN LINKED LIST Solution GFG
FIND MID NODE IN LINKED LIST Solution LEETCODE
REVERSE A LINKED LIST Solution LEETCODE
ROTATE A LINKED LIST IN K TIMES Solution LEETCODE
REMOVE DUPLICATE FROM SORTED LINKED LIST Solution LEETCODE
FIND THE SOME OF LAST N NODE OF LINKED LIST Solution GFG
VALIDATE PALINDROME LINKED LIST Solution LEETCODE
DETECT CYCLE IN LINKED LIST Solution LEETCODE
PAIR SWAP Solution LEETCODE
MERGED TWO SORTED LINKED LIST Solution LEETCODE

RECURSION

Problems Solution Platform
FIND STRING LENGTH STR_LEN.PY GFG
DELETE X FROM STRING STR_DEL_X.PY GFG
REPLACE X WITH Y IN STRING STR_REPLACE_X.PY GFG
REMOVE CONSICUTIVE DUPLICATES REMOVE_CONSICUTIVE_DUPLICATES.PY GFG
SUM OF NATURAL NUMBERS SUM_OF_N_NATURAL_NO.PY GFG
FINDING EXPONENSIAL EXPONENSIAL.PY GFG
FIND NO OF WAYS IN MATRIX FIND_NO_OF_WAYS_IN_NxM.PY GFG
JOSEPHUS PROBLEM JOSEPHUS_PROBLEM.PY GFG
CHECKING PALINDROME STRING PALINDROME_STRING.PY GFG
PRINT ALL PERMUTATIONS OF STRING PRINT_ALL_PERMUTATION_GIVEN_STRING.PY GFG
PRINT SUBSEQUENCES OF STRING PRINT_SUBSEQUENCE_OF_GIVEN_STRING.PY GFG
REVERSE A STRING USING RECURSION REVERSE_STRING.PY GFG
SUBSETS OF TARGETSUM SUBSETS_OF_TARGETSUM.PY GFG
ALL POSSIBLE STAIR CASE STAIR_CASE.PY LEETCODE
SPECIAL FIBONACCI SPECIAL_FIBO.PY CODECHEF
EXPLORE ALL POSSIBLE MAZE PATH MAZE_FINDING.PY GFG
EXPLORE ALL POSSIBLE MAZE PATH WITH JUMP MAZE_FIND_WITH_JUMP.PY PEPCODING
KEYPAD COMBINATIONS KEYPAD_COMBINATIONS.PY LEETCODE

HASHMAP

Problems Solution Platform
AFTER COLLISION HASHING Solution GFG
BEFORE COLLISION HASHING Solution GFG
COUNT DISTINCT ELEMENT IN EVERY WINDOW Solution GFG
INTERSECTION OF TWO SORTED ARRAY Solution GFG
LONGEST CONSICUTIVE Solution LEETCODE
LONGEST SUBARRAY WITH ZERO SUM Solution LEETCODE
MAXIMUM DISTANCE BETWEEN SAME ELEMENT Solution GFG
NON REPEAT Solution GFG
SORTING ELEMENT OF AN ARRAY BY FREQUENCY Solution LEETCODE
TOP K FREQUENT ELEMENT IN ARRAY Solution GFG
IS TWO ARRAY SAME OR NOT Solution GFG

SORTING

Problems Solution Platform
BUBBLE SORT Solution GFG
INSERTION SORT Solution GFG
SELECTION SORT Solution GFG
SHELL SORT Solution GFG
QUICK SORT Solution GFG
MERGE SORT Solution GFG
REDIX SORT Solution GFG
BUCKET SORT Solution GFG
COUNTING SORT Solution GFG
HEAP SORT Solution GFG
MINIMUM SWAP TO SORT A ARRAY Solution GFG
MINIMUM SWAP Solution GFG
SORT 0 1 2 IN ARRAY Solution LEETCODE
UNION OR TWO SORTED ARRAY Solution GFG

SEARCHING

Problems Solution Platform
LINEAR SEARCH Solution GFG
BINARY SEARCH Solution GFG
TERNARY SEARCH Solution GFG
SEARCH SORTED ROTATED ARRAY Solution LEETCODE
SEARCH MINIMUM PLATFORMS Solution GFG
SEARCH PEAK ELEMENT Solution LEETCODE
SEARCH MISSING REPEATING VALUE Solution GFG
SEARCH MEDIAN OF TWO SORTED ARRAY Solution GFG

TREE

Problems Solution Platform
TREE CREATION Solution GFG
GENERIC TREE CREATION Solution GFG
GENERIC TREE CREATION 2.0 Solution GFG
DEPTHWISE GENERIC TREE TRAVERSAL Solution GFG
LEVELWISE GENERIC TREE TRAVERSAL Solution GFG
LEVEL LINEWISE GENERIC TREE TRAVERSAL Solution GFG
ZIG ZAG LINEWISE GENERIC TREE TRAVERSAL Solution GFG
MIRROR OF GENERIC TREE Solution GFG
MAXIMUM NODE FROM TREE Solution GFG
LINEARIZE GENERIC TREE Solution PEPCODING
FIND ELEMENT IN GENERIC TREE Solution GFG
REMOVE LEAF NODES IN GENERIC TREE Solution GFG
NODE TO ROOT PATH GENERIC TREE Solution GFG
LOWEST COMMON ANCESTOR IN GENERIC TREE Solution GFG
DIFFERENCE BETWEEN TWO NODE IN GENERIC TREE Solution GFG
CEIL AND FLOOR OF GIVEN VALUE IN GENERIC TREE Solution PEPCODING
GET DIAMETER IN GENERIC TREE Solution GFG
GET SUCCESSOR-PREDESESSOR IN GENERIC TREE Solution GFG
IS SAME SHAPE WITH MIRROR TREE IN GENERIC TREE Solution PEPCODING
IS SAME IN SHAPE IN GENERIC TREE Solution PEPCODING
IS SYMETRIC IN GENERIC TREE Solution PEPCODING
K TH LARGEST ELEMENT IN GENERIC TREE Solution PEPCODING
MAX SUBTREE SUM IN GENERIC TREE Solution GFG
BINARY TREE CREATION Solution GFG
BINARY_TREE Solution
BRANCH SUM BINARY TREE Solution
LEFT CLONE TREE BINARY TREE Solution PEPCODING
NODE TO ROOT PATH BINARY TREE Solution LEETCODE
PATH SUM BINARY TREE Solution
PRINT K LEVEL DOWN BINARY TREE Solution GFG
REMOVE SINGLE CHILD BINARY TREE Solution
AVL TREE Solution GFG

Trie

Problems Solution Platform
Trie 1.0 Solution Leetcode
Trie 2.0 Solution Codingninja
Longest Word in Dictionary Solution Leetcode
Number of Distinct Substrings Solution Codingninja
Common Element Solution Codingninja
Maximum xor Solution Codingninja
Maximum xor queries Solution Codingninja
Word break 2 Solution Codingninja
Phone directory Solution Codingninja

GRAPH

Problems Solution Platform
GRAPH CREATION SET Solution GFG
GRAPH CREATION LIST Solution GFG
GRAPH CREATION MATRIX Solution GFG
DFS Solution GFG
GET CONNECTED COMPONENTS Solution GFG
IS GRAPH CONNECTED Solution GFG
GET NUMBER OF ISLANDS Solution LEETCODE
PERFECT FRIENDS Solution GFG
HAMILTON PATH Solution GFG
KNIGHT TOUR Solution GFG
BFS Solution GFG
SPREAD INFECTION PROBLEM Solution GFG
IS GRAPH CYCLIC Solution GFG
IS GRAPH BIPARTITE Solution LEETCODE
DIJSTRA'S ALGORITHM Solution GFG
KRUSKAL'S ALGORITHM Solution GFG
PRIM'S ALGORITHM Solution GFG
FLOYD WARSHAL Solution GFG

DIVIDE AND CONQURE

Problems Solution Platform
FINDING EXPONENTIAL Solution GFG
LARGE NUMBER MULTIPLICAIOTN Solution GFG
MIN MAX PROBLEM Solution GFG
STRASSEN'S MATRIX MULTIPLICAOINT Solution GFG

BIT MANIPULATION

Problems Solution Platform
BASIC OPERAIONS Solution
BIT DIFFERENCE PROBLEM Solution GFG
BINARY TO GREY CODE EQUIVALENCE Solution GFG
CHECK K BIT Solution GFG
FIND FIRST SET BIT Solution GFG
IS POWER OF TWO Solution LEETCODE
NUMBER IS SPARSE OR NOT Solution GFG
SWAPP ALL ODD AND EVEN BITS Solution GFG
COUNT TOTAL SET BITS Solution GFG
MAXIMUM SUBSET XOR Solution GFG
RIGHTMOST DIFFERENT BIT Solution GFG
EQUAL SUM AND XOR Solution GFG
LONGEST CONSICUTIVE ONE'S Solution GFG
MIDORI AND CHOCOLATE PROBLEM Solution GFG
NON REPEATING TWO DUPLICATE VALUES Solution GFG
PARTY COUPLE PROBLEM (ONE DUPLICATE) Solution GFG
Number of Valid Words IN Puzzle Solution LEETCODE
One Repeating And One Missing Solution PEPCODING
Grey Code Solution PEPCODING
Josephus Problem Solution GFG
Min Num of Software Devs Solution PEPCODING

GREEDY

Problems Solution Platform
01 KNAPSACK PROBLEM Solution GFG
FRACTIONAL KNAPSACK Solution GFG
DECODE STRING WAYS PROBLEM Solution LEETCODE
LONGEST COMMON SUBSEQUENCE Solution GFG
OPEN PARANTHESIS PROBLEM Solution GFG
PARTITION SET K SUM Solution GFG
STAIR CASE PROBLEM Solution LEETCODE

BACKTRACKING

Problems Solution Platform
FLOOD FILL ALGO Solution GFG
TARGET SUBSET SUM Solution GFG
N QUEEN PROBLEM Solution GFG
KNIGHT TOUR Solution GFG
SUDUKO SOLVER Solution LEETCODE
TRAVELLING SALESMAN PROBLEM Solution GFG
MAX SCORE Solution LEETCODE
PRINT LEXICLE GRAPHI ORDER Solution GFG
STRING ABBRIVATION Solution GFG
K PARTITION Solution PEPCODING
K EQUAL SUM Solution LEETCODE
FRIEND PAIRING 2 Solution PEPCODING
GOLDMINE 2 Solution GFG
LARGEST NUM AFTER K SWAP Solution GFG
TUG OF WAR Solution GFG
PERMUTATAION 1 Solution PEPCODING
COMBINATION 1 Solution PEPCODING
ALL PALINDROMIC PARTITION Solution LEETCODE
ALL PALINDROMIC PERMUTATION Solution PEPCODING
N QUEEN BRANCH BOUND Solution GFG
WORD BREAK 1 Solution LEETCODE
PATTERN MATCHING Solution LEETCODE
REMOVE INVALID PARANTHESIS Solution LEETCODE
CROSSWORD PUZZLE Solution HACKERRANK
CRIPT ARITHMETIC Solution GFG
PERMUTATION 2 Solution PEPCODING
PERMUTATION WORD 1 Solution PEPCODING
PERMUTATION WORD 2 Solution PEPCODING
COMBINATION 2 Solution PEPCODING
WORD K SELECTION 1 Solution PEPCODING
WORD K SELECTION 2 Solution PEPCODING
WORD K SELECTION 3 Solution PEPCODING
WORD K SELECTION 4 Solution PEPCODING
WORD K LEN 1 Solution PEPCODING
WORD K LEN 2 Solution PEPCODING
QUEEN COMBINATION BOX CHOOSE 1 Solution PEPCODING
QUEEN COMBINATION BOX CHOOSE 2 Solution PEPCODING
QUEEN PERMUTATION BOX CHOOSE 1 Solution PEPCODING
QUEEN PERMUTATION BOX CHOOSE 2 Solution PEPCODING
QUEEN COMBINATION BOX CHOOSE 1D Solution PEPCODING
QUEEN COMBINATION WITH SAFE 1D Solution PEPCODING
QUEEN PERMUTATOIN WITH SAFE 1D Solution PEPCODING
COIN CHANGE COMBINATION 1 Solution PEPCODING
COIN CHANGE COMBINATION 2 Solution PEPCODING
COIN CHANGE PERMUTATION 1 Solution PEPCODING
COIN CHANGE PERMUTATION 2 Solution PEPCODING
RESTORE IP ADDRESS Solution PEPCODING

DYNAMIC PROGRAMMING

Problems Solution Platform
FIBONACCI SEQUENCE Solution GFG
01 KNAPSACK Solution GFG
UNBOUNDED 01 KNAPSACK Solution GFG
ASSEMBLY LINE SHEDULAR Solution GFG
BIONOMIAL Solution GFG
DECODE STRING WAYS DP APPROACH Solution LEETCODE
EDIT DISTANCE BETWEEN TWO STRING DP APPROACH Solution GFG
LONGEST COMMON SUBSEQUENCE DP APPROACH Solution GFG
MAKING CHAIN PROBLEM Solution GFG
SUBSET SUM PROBLEM Solution GFG
MIN PATH SUM PROBLEM Solution LEETCODE
CLIMB STAIRS PROBLEM Solution LEETCODE
CLIMB STAIRS WITH JUMP Solution PEPCODING
CLIMB STAIRS WITH MIN JUMP Solution PEPCODING
MOST COST CLIMB STAIRS Solution LEETCODE
GOLDMINE DIG PROBLEM Solution GFG
COIN CHANGE PERMUTATION Solution PEPCODING
COIN CHANGE COMBINATIONS Solution LEETCODE
DECODE WAYS Solution LEETCODE
COUNT BINARY STRING Solution GFG
ARRANGE THE BUILDING Solution PEPCODING
COUNT SUBSEQUENCE OF A+B+C Solution GFG
MAX SUM OF TWO NON ADJUCENT Solution GFG
PAINT HOUSE Solution GFG
PAINT HOUSE 2 Solution PEPCODING
PAINT FENCE PROBLEM Solution GFG
TILLING 2x1 PROBLEM Solution PEPCODING
MATRIX SUM RECTANGLE Solution GFG
RANGE QUERY SUM PROBLEM Solution GFG
TOTAL COUNT BINARY SEARCH TREE Solution GFG
EGG DROPPING WITH DP APPROACH Solution GFG
EGG DROPPING WITH DP APPROACH WITH SECOND APPROACH Solution GFG
FIND NEXT PERMUTATION Solution LEETCODE
PASCAL TRIANGLE Solution LEETCODE