Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/prakharjadaun/dsa

Repository contains implementation of different data structures and problems related to them.
https://github.com/prakharjadaun/dsa

competitive-programming data-structures dsa-learning-series dynamic-programming implementation-of-algorithms interview leetcode-solutions placement-preparation problem-solving

Last synced: 2 months ago
JSON representation

Repository contains implementation of different data structures and problems related to them.

Awesome Lists containing this project

README

        




Markdownify


Master Data Structures and Algorithms with ease



Arrays
Strings
Bitwise Manip.
Linked List
Queue
Stack
Hash Table
Sorting



Searching
Recursion
Binary Tree
Binary Search Tree
Graph
Dynamic Programming



Numbers
Favorites

Count : 471

Numbers

- [Ugly Numbers](https://leetcode.com/problems/ugly-number/description/)
- [Power of x^n](https://leetcode.com/problems/powx-n/)
- [Insert Interval](https://leetcode.com/problems/insert-interval/description/?envType=study-plan-v2&envId=top-interview-150)
- [Minimum number of arrows to burst balloons](https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/description/?envType=study-plan-v2&envId=top-interview-150)
- [Max points on a line](https://leetcode.com/problems/max-points-on-a-line/description/?envType=study-plan-v2&envId=top-interview-150)

Arrays

#### **Basic Programs**

- Reverse an array.
- Maximum and minimum element in the array.
- Kth Smallest Element of Array
- Sort an array of 0s, 1s and 2s
- Sort an array of 0s, 1s and 2s (two pointer approach)
- Move all negative numbers to beginning and positive to end.
- Find the count of union of the two arrays
- Rotate an array by 1 in the clockwise direction
- Print all permutations of array
- [Kids with the greatest number of candies](https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/description/)
- [Create Target Array in the Given Order](https://leetcode.com/problems/create-target-array-in-the-given-order/description/)
- [Decompress run length encoded list](https://leetcode.com/problems/decompress-run-length-encoded-list/description/)
- [Count items matching a rule](https://leetcode.com/problems/count-items-matching-a-rule/description/)
- [Widest vertical area between two points](https://leetcode.com/problems/widest-vertical-area-between-two-points-containing-no-points/description/)
- [Rearranging the array elements by sign](https://leetcode.com/problems/rearrange-array-elements-by-sign/description/)
- [Largest Altitude of biker](https://leetcode.com/problems/find-the-highest-altitude/description/)
- [Count Number of Distinct Integers After Reverse](https://leetcode.com/problems/count-number-of-distinct-integers-after-reverse-operations/)
- [Triangular Sum of an array](https://leetcode.com/problems/find-triangular-sum-of-an-array/description/)
- [Jewels in Stones](https://leetcode.com/problems/jewels-and-stones/description/)
- [Minimum Sum of four digits number after splitting](https://leetcode.com/problems/minimum-sum-of-four-digit-number-after-splitting-digits/description/)
- [Intersection of Multiple Arrays](https://leetcode.com/problems/intersection-of-multiple-arrays/description/)
- [Move Zeros](https://leetcode.com/problems/move-zeroes/description/)
- [Matrix Diagonal sum](https://leetcode.com/problems/matrix-diagonal-sum/description/)
- [Flip an image](https://leetcode.com/problems/flipping-an-image/description/)
- [Missing number](https://leetcode.com/problems/missing-number/description/)
- [Happy number](https://leetcode.com/problems/happy-number/description/)
- [Maximum ice cream](https://leetcode.com/problems/maximum-ice-cream-bars/description/)
- [N unique integers which sum up to zero](https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/description/)
- [Monotonic Array](https://leetcode.com/problems/monotonic-array/description/)
- [Largest Positive Integer That Exists With Its Negative](https://leetcode.com/problems/largest-positive-integer-that-exists-with-its-negative/description/)
- [Find Words That Can Be Formed by Characters](https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/description/)
- [Sort array by parity](https://leetcode.com/problems/sort-array-by-parity/description/)
- [Separate Digits in array](https://leetcode.com/problems/separate-the-digits-in-an-array/description/)
- [Third max number](https://leetcode.com/problems/third-maximum-number/description/)
- [Is subarray Exists with sum 0](https://practice.geeksforgeeks.org/problems/subarray-with-0-sum/0)
- [Lonely Numbers in the array](https://leetcode.com/problems/find-all-lonely-numbers-in-the-array/description/)
- [Can Place Flowers](https://leetcode.com/problems/can-place-flowers/description/)
- [Duplicate Zeros](https://leetcode.com/problems/duplicate-zeros/description/)
- [Shuffle an array](https://leetcode.com/problems/shuffle-an-array/description/)
- [Find winner on a tic tac toe game](https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game/description/)
- [Check if every row and column contains all numbers](https://leetcode.com/problems/check-if-every-row-and-column-contains-all-numbers/description/)
- [Roman to Integer](https://leetcode.com/problems/roman-to-integer/description/)
- [Find the Distance Value Between Two Arrays](https://leetcode.com/problems/find-the-distance-value-between-two-arrays/description/)
- [Peak Index in a mountain array](https://leetcode.com/problems/peak-index-in-a-mountain-array/description/)
- [Find a peak element](https://leetcode.com/problems/find-peak-element/description/?envType=study-plan-v2&envId=top-interview-150)

#### **Problems**

- Largest Sum Contiguous Subarray (Kadane’s Algorithm)
- Difference of two arrays
- Intersection of two arrays
- [3 Sum](https://leetcode.com/problems/3sum/description/)
- [2 Sum](https://leetcode.com/problems/two-sum/description/)
- [4 Sum](https://leetcode.com/problems/4sum/description/)
- [Palindrome](https://leetcode.com/problems/palindrome-number/description/)
- [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/)
- [Length of last word](https://leetcode.com/problems/length-of-last-word/description/)
- [Plus One (adding one to an array representing a large number)](https://leetcode.com/problems/plus-one/description/)
- [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/)
- [Valid Palindrome String](https://leetcode.com/problems/valid-palindrome/description/)
- [Middle Of Threee](https://practice.geeksforgeeks.org/problems/middle-of-three2926/1?page=1&category[]=Numbers&sortBy=submissions)
- [Median of two sorted arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/description/)
- [Reverse Integer](https://leetcode.com/problems/reverse-integer/description/)
- [Remove element](https://leetcode.com/problems/remove-element/description/)
- [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/description/)
- [3 sum closest](https://leetcode.com/problems/3sum-closest/description/)
- [Word Pattern](https://leetcode.com/problems/word-pattern/description/)
- [Sort Colors](https://leetcode.com/problems/sort-colors/description/)
- [Build array from permutation](https://leetcode.com/problems/build-array-from-permutation/description/)
- [Shuffle the array](https://leetcode.com/problems/shuffle-the-array/description/)
- [Queries on Number of Points Inside a Circle](https://leetcode.com/problems/queries-on-number-of-points-inside-a-circle/description/)
- [Strictly Palidromic Number](https://leetcode.com/problems/strictly-palindromic-number/)
- [Divide Array Into Equal Pairs](https://leetcode.com/problems/divide-array-into-equal-pairs/description/)
- [Squares of a sorted array](https://leetcode.com/problems/squares-of-a-sorted-array/description/)
- [Rotate image](https://leetcode.com/problems/rotate-image/description/)
- [Merge Intervals](https://leetcode.com/problems/merge-intervals/description/)
- [Delete Greatest Value in Each Row](https://leetcode.com/problems/delete-greatest-value-in-each-row/description/)
- [Sort the students](https://leetcode.com/problems/sort-the-students-by-their-kth-score/description/)
- [Largest Number](https://leetcode.com/problems/largest-number/description/)
- [Sort the number of 1 bits](https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits/description/)
- [Check if matrix is X-matrix](https://leetcode.com/problems/check-if-matrix-is-x-matrix/description/)
- [Group anagrams](https://leetcode.com/problems/group-anagrams/description/)
- [Add to array form](https://leetcode.com/problems/add-to-array-form-of-integer/description/)
- [Find all the numbers that disappeared in an array](https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/description/)
- [Rotate the array](https://leetcode.com/problems/rotate-array/description/)
- [Find lucky number](https://leetcode.com/problems/find-lucky-integer-in-an-array/description/)
- [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/description/)
- Disarrange Balls
- [Count rows with max 1](https://practice.geeksforgeeks.org/problems/row-with-max-1s0023/1)
- [Relative Sort Array](https://leetcode.com/problems/relative-sort-array/description/)
- [Remove One Element to Make the Array Strictly Increasing](https://leetcode.com/problems/remove-one-element-to-make-the-array-strictly-increasing/description/)
- [Successful pairs of potions and spells](https://leetcode.com/problems/successful-pairs-of-spells-and-potions/description/)
- [Valid mountain array](https://leetcode.com/problems/valid-mountain-array/)
- [Longest mountain array](https://leetcode.com/problems/longest-mountain-in-array/description/)

#### **Matrix**

- [Matrix rotation by 90 degree](https://leetcode.com/problems/rotate-image/?envType=study-plan-v2&envId=top-interview-150)
- [Set Matrix Zeros](https://leetcode.com/problems/set-matrix-zeroes/description/?envType=study-plan-v2&envId=top-interview-150)
- [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/description/?envType=study-plan-v2&envId=top-interview-150)
- [Reshape the matrix](https://leetcode.com/problems/reshape-the-matrix/description/)
- [Search in a matrix](https://leetcode.com/problems/search-a-2d-matrix/description/?envType=study-plan-v2&envId=top-interview-150)
- [Is Valid Sudoku](https://leetcode.com/problems/valid-sudoku/submissions/?envType=study-plan-v2&envId=top-interview-150)
- [Sort the matrix diagonally](https://leetcode.com/problems/sort-the-matrix-diagonally/description/)

Strings

- String Basics
- Print all permutations of the string
- Subsequences of string
- Longest recurring subsequence of a string
- [Add Binary](https://leetcode.com/problems/add-binary/description/)
- [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/description/)
- [Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/)
- [Maximum number of words found in a sentence](https://leetcode.com/problems/maximum-number-of-words-found-in-sentences/description/)
- [Defang Ip address](https://leetcode.com/problems/defanging-an-ip-address/description/)
- [Restore strings](https://leetcode.com/problems/shuffle-string/description/)
- [Interpret Goal](https://leetcode.com/problems/goal-parser-interpretation/description/)
- [Kth Distinct String in an Array](https://leetcode.com/problems/kth-distinct-string-in-an-array/description/)
- [Merge strings alternatively](https://leetcode.com/problems/merge-strings-alternately/description/)
- [Valid anagram](https://leetcode.com/problems/valid-anagram/description/)
- [Find the difference](https://leetcode.com/problems/find-the-difference/description/)
- [First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/description/)
- [Number of good ways to split a string](https://leetcode.com/problems/number-of-good-ways-to-split-a-string/description/)
- [Counting words with a given prefix](https://leetcode.com/problems/counting-words-with-a-given-prefix/description/)
- [Greatest common divisor of strings](https://leetcode.com/problems/greatest-common-divisor-of-strings/description/)
- [Check distance between same letters](https://leetcode.com/problems/check-distances-between-same-letters/description/)
- [Number of different integers in the string](https://leetcode.com/problems/number-of-different-integers-in-a-string/description/)
- [Check whether two string are rotation of each other or not](https://www.geeksforgeeks.org/a-program-to-check-if-strings-are-rotations-of-each-other/)
- [Longest Palindromic Substring](https://practice.geeksforgeeks.org/problems/longest-palindrome-in-a-string3411/1)
- [Most common words](https://leetcode.com/problems/most-common-word/description/)
- [DI String match](https://leetcode.com/problems/di-string-match/description/)
- [Count prefixes of a given string](https://leetcode.com/problems/count-prefixes-of-a-given-string/description/)
- [Sort Characters By Frequency](https://leetcode.com/problems/sort-characters-by-frequency/description/)
- [Count Common Words With One Occurrence](https://leetcode.com/problems/count-common-words-with-one-occurrence/description/)
- [Rearrange Characters to Make Target String](https://leetcode.com/problems/rearrange-characters-to-make-target-string/description/)
- [Unique Morse Code Words](https://leetcode.com/problems/unique-morse-code-words/description/)
- [Percentage of a letter](https://leetcode.com/problems/percentage-of-letter-in-string/description/)
- [Check if Word Equals Summation of Two Words](https://leetcode.com/problems/check-if-word-equals-summation-of-two-words/description/)
- [Check if Number Has Equal Digit Count and Digit Value](https://leetcode.com/problems/check-if-number-has-equal-digit-count-and-digit-value/description/)
- [Circular Sentence](https://leetcode.com/problems/circular-sentence/description/)
- [Isomorphic strings](https://leetcode.com/problems/isomorphic-strings/description/)
- [Minimum Index Sum of Two Lists](https://leetcode.com/problems/minimum-index-sum-of-two-lists/description/)
- [Greatest English Letter in Upper and Lower Case](https://leetcode.com/problems/greatest-english-letter-in-upper-and-lower-case/description/)
- [Second largest digit in a string](https://leetcode.com/problems/second-largest-digit-in-a-string/description/)
- [Sort a sentence](https://leetcode.com/problems/sorting-the-sentence/description/)
- [Summary ranges](https://leetcode.com/problems/summary-ranges/description/)
- [Robot return to origin](https://leetcode.com/problems/robot-return-to-origin/description/)
- [Maximum Nesting Depth of the Parentheses](https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses/description/)
- [Reverse prefix of word](https://leetcode.com/problems/reverse-prefix-of-word/description/)
- [Determine color of a chessboard square](https://leetcode.com/problems/determine-color-of-a-chessboard-square/description/)
- [Partition String](https://leetcode.com/problems/optimal-partition-of-string/description/)
- [Minimum number of steps to make two strings anagram](https://leetcode.com/problems/minimum-number-of-steps-to-make-two-strings-anagram/description/)
- [Goat Latin](https://leetcode.com/problems/goat-latin/description/)
- [Smallest string with a given numeric value](https://leetcode.com/problems/smallest-string-with-a-given-numeric-value/description/)
- [Check if a word occurs as a prefix of any word in a sentence](https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence/description/)
- [Count pairs of similar strings](https://leetcode.com/problems/count-pairs-of-similar-strings/description/)
- [Add string](https://leetcode.com/problems/add-strings/description/)
- [Is Subsequence](https://leetcode.com/problems/is-subsequence/description/?envType=study-plan-v2&envId=top-interview-150)
- [Buddy Strings](https://leetcode.com/problems/buddy-strings/description/)
- [Bulls and cows](https://leetcode.com/problems/bulls-and-cows/description/)

Bitwise Operations

- Understanding Bitwise operators.
- Binary Representation of number.
- [Find the number that appears once.](https://leetcode.com/problems/single-number/description/)
- [Detect if two integers have opposite signs](https://www.geeksforgeeks.org/detect-if-two-integers-have-opposite-signs/)
- [Add 1 to a number when all the arithmetic operators are not allowed](https://www.geeksforgeeks.org/add-1-to-a-given-number/)
- [Mutliply with 3.5 without 'x' and '/' operator](https://www.geeksforgeeks.org/multiply-an-integer-with-3-5/)
- [Turn off the rightmost set bit](https://www.geeksforgeeks.org/turn-off-the-rightmost-set-bit/)
- [Find whether a given number is a power of 4 or not](https://www.geeksforgeeks.org/find-whether-a-given-number-is-a-power-of-4-or-not/#discuss)
- [Compute modulus division by a power-of-2-number](https://www.geeksforgeeks.org/compute-modulus-division-by-a-power-of-2-number/)
- [Rotate Bits](https://practice.geeksforgeeks.org/problems/rotate-bits4524/1?utm_source=gfg)
- [Hamming weights (Number of 1 bits)](https://leetcode.com/problems/number-of-1-bits/description/)
- [Reverse Bits](https://leetcode.com/problems/reverse-bits/description/)
- [Power Of two](https://leetcode.com/problems/power-of-two/description/)
- [Bitwise & of numbers in range](https://leetcode.com/problems/bitwise-and-of-numbers-range/description/)
- [Find the duplicate number](https://leetcode.com/problems/find-the-duplicate-number/)
- [Party of couples (Find number with odd frequency)](https://practice.geeksforgeeks.org/problems/alone-in-couple5507/1)
- [Check for Integer Overflow](https://www.geeksforgeeks.org/check-for-integer-overflow/)
- [Count bit flips(Number of bits to be changed to convert one number to another)](https://practice.geeksforgeeks.org/problems/bit-difference-1587115620/1)
- [Efficient way to multiply by 7](https://www.geeksforgeeks.org/efficient-way-to-multiply-with-7/)

Linked List

#### **Basic Programs**

- Insertion at the end.
- Insertion at the beginning.
- Insertion at the middle of the linked list.
- Deleting the last node.
- Deleting the first node.
- Deleting the middle node.
- Calculating the length of list using iteration and the recursion.
- Searching an item using iteration and recursion.
- Implementation of doubly linked list.

#### **Circular Linked List**

- Creating a circular linked list from scratch.
- Inserting at end and beginning of the circular linked list
- Deleting the last and the first element of the circular linked list.

#### **Problems**

- Get the Nth node from the last.
- Detecting a loop in a linked list.
- Detecting the length of loop in a linked list. (Using Floyd's Cycle detection algorithm)
- Detect and remove loop from the linked list.
- Check if single linked list is palindrome or not.
- Removing Duplicate elements from unsorted linked list.
- Swapping nodes in a linked list.
- Merge two sorted linked list.
- Add two numbers represented by linked list.
- Rotate a linked list.
- Find the nth node of the linked list from the end.
- Convert binary number in a linked list to an integer.
- [Merge nodes in between zeros](https://leetcode.com/problems/merge-nodes-in-between-zeros/)
- [Maximum twin sum](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/description/)
- [Odd even linked list](https://leetcode.com/problems/odd-even-linked-list/description/)
- [Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/description/)
- [Design linked list](https://leetcode.com/problems/design-linked-list/description/)
- [Reorder List](https://leetcode.com/problems/reorder-list/description/)
- [Swap nodes in pairs](https://leetcode.com/problems/swap-nodes-in-pairs/description/)
- [Reverse Linked List II](https://leetcode.com/problems/reverse-linked-list-ii/description/)
- [Copy Linked list with Random Head](https://leetcode.com/problems/copy-list-with-random-pointer/description/?envType=study-plan-v2&envId=top-interview-150)
- [Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/description/?envType=study-plan-v2&envId=top-interview-150)
- [Intersection of two linked list](https://practice.geeksforgeeks.org/problems/intersection-of-two-sorted-linked-lists/1)
- [Remove nth node from the end of linked list](https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/)
- [Reverse List in K Groups](https://leetcode.com/problems/reverse-nodes-in-k-group/submissions/?envType=study-plan-v2&envId=top-interview-150)
- [Flatten a multilevel doubly linked list](https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/description/)
- [Next Greater Node in the Linked List](https://leetcode.com/problems/next-greater-node-in-linked-list/description/)
- [Double a number represented by a linked list](https://leetcode.com/problems/double-a-number-represented-as-a-linked-list/)

Queue

#### **Basic Program**

- Basic operations of queue
- Queue using stack.
- Priority Queue using STL.
- Priority Queue using linked list.

#### **Problems**

- [Kth Smallest element in a matrix](https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/description/)
- [Design a circular queue](https://leetcode.com/problems/design-circular-deque/)

Hash Table

#### **Basic Programs**

- [Create Hashset](https://leetcode.com/problems/design-hashset/)
- [Create Hashmap](https://leetcode.com/problems/design-hashmap/description/)
- [Most Frequent number of following key in an array](https://leetcode.com/problems/most-frequent-number-following-key-in-an-array/description/)
- [Keyboard Row](https://leetcode.com/problems/keyboard-row/description/)
- [Uncommon Words from Two Sentences](https://leetcode.com/problems/uncommon-words-from-two-sentences/description/)
- [N-Repeated Element in Size 2N Array](https://leetcode.com/problems/n-repeated-element-in-size-2n-array/description/)
- [Rank Transform of an Array](https://leetcode.com/problems/rank-transform-of-an-array/description/)

#### **Problems**

- Find whether an array is a subset of another array
- Union and Intersection of two linked list.
- Given an array A[] and a number x, check for pair in A[] with sum as x
- Minimum delete operations to make all elements of array same.
- Minimum operations to make all elements equal in array.
- Maximum distance between two occurrences of same element in array
- Find duplicates in a given array when elements are not limited to a range
- Smallest subarray with all occurrences of a most frequent element.
- Find elements which are present in first array and not in second array.
- How to check if two subsets are disjoint.
- Non-overlapping sum of two sets.
- Find missing elements of a range.
- Find the kth missing element in increasing sequence which is not present in a given sequence
- Find pair with greatest pair in array.
- Minimum number of subsets with distinct elements
- Remove minimum number of elements such that no common element exist in both array.
- Count items common to both the lists but with different prices.
- Ransom Note : check whether string 1 can be constructed from string 2
- [Decode the message](https://leetcode.com/problems/decode-the-message/description/)
- [Maximum Number of Words You Can Type](https://leetcode.com/problems/maximum-number-of-words-you-can-type/description/)
- [Check if a string is pangram](https://leetcode.com/problems/check-if-the-sentence-is-pangram/description/)
- [Merge similar items](https://leetcode.com/problems/merge-similar-items/description/)
- [Maximum number of balls in a box](https://leetcode.com/problems/maximum-number-of-balls-in-a-box/description/)
- [Two out of three](https://leetcode.com/problems/two-out-of-three/description/)
- [Sort array by increaing frequency](https://leetcode.com/problems/sort-array-by-increasing-frequency/description/)
- [Top K frequent elements](https://leetcode.com/problems/top-k-frequent-elements/description/)
- [https://leetcode.com/problems/count-vowel-substrings-of-a-string/description/](https://leetcode.com/problems/count-vowel-substrings-of-a-string/description/)
- [Replace words](https://leetcode.com/problems/replace-words/description/)
- [Keep Multiplying Found Values by Two](https://leetcode.com/problems/keep-multiplying-found-values-by-two/description/)
- [Most Frequent Even Element](https://leetcode.com/problems/most-frequent-even-element/description/)
- [Rings and Rods](https://leetcode.com/problems/rings-and-rods/description/)
- [Finding the user active minutes](https://leetcode.com/problems/finding-the-users-active-minutes/description/)
- [Subdomain Visit Counts](https://leetcode.com/problems/subdomain-visit-count/description/)
- [Players with zero or one losses](https://leetcode.com/problems/find-players-with-zero-or-one-losses/description/)
- [Equal row and column pairs](https://leetcode.com/problems/equal-row-and-column-pairs/description/)
- [Check whether two strings are almost equivalent](https://leetcode.com/problems/check-whether-two-strings-are-almost-equivalent/description/)
- [Distribute candies](https://leetcode.com/problems/distribute-candies/description/)
- [Smallest number in infinite set](https://leetcode.com/problems/smallest-number-in-infinite-set/description/)
- [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/description/?envType=study-plan-v2&envId=top-interview-150)
- [Insert delete get random in O(1)](https://leetcode.com/problems/insert-delete-getrandom-o1/description/)
- [Design Underground System](https://leetcode.com/problems/design-underground-system/description/)

Stack

#### **Basic programs**

- Basic operations of stack.
- Implementing stack using queues.
- Reverse a string using stack.

#### **Problems**

- Find the middle element of the stack in O(1) complexity.
- Implement stack using a single queue.
- Reverse individual words.
- Next Greater Element
- [Next Smaller Element](https://www.codingninjas.com/codestudio/problems/next-smaller-element_1112581?leftPanelTab=0)
- Valid parenthesis
- [Minimum remove to make valid parentheses](https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/description/?envType=daily-question&envId=2024-04-06)
- [Design a stack with increment operation](https://leetcode.com/problems/design-a-stack-with-increment-operation/description/)
- [Baseball game](https://leetcode.com/problems/baseball-game/description/)
- [Min stack](https://leetcode.com/problems/min-stack/description/)
- [Removing stars from a string](https://leetcode.com/problems/removing-stars-from-a-string/description/)
- [Simply Path](https://leetcode.com/problems/simplify-path/description/?envType=study-plan-v2&envId=top-interview-150)
- [Evaluate Reverse Polish Notation](https://leetcode.com/problems/evaluate-reverse-polish-notation/description/?envType=study-plan-v2&envId=top-interview-150)
- [Remove outer parentheses](https://leetcode.com/problems/remove-outermost-parentheses/description/)

Sorting

#### **Types of Sorting Algo and their uses**

- Bubble Sort
- Insertion Sort
- Heap Sort
- [Merge Sort](https://www.codingninjas.com/studio/problems/merge-sort_920442)
- [Quick sort](https://www.codingninjas.com/studio/problems/quick-sort_983625)

#### **Problems**

- [Smaller number than current](https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number/description/)
- [H index](https://leetcode.com/problems/h-index/description/?envType=study-plan-v2&envId=top-interview-150)
- [Count Inversions (Merge Sort)](https://www.codingninjas.com/studio/problems/count-inversions_615?leftPanelTab=0)

Searching

- Unordered Linear Search
- Ordered Linear Search
- Binary Search
- Interpolation search

#### **Problems**

- Maximum frequency of an element in array

Recursion

#### **Basic Programs**

- Factorial using recursion
- Print numbers 1 to N in backwards
- Fibonacci Series
- Binary Search

#### **Problems**

- [N Queens problem I](https://leetcode.com/problems/n-queens/description/)
- [Combination sum](https://leetcode.com/problems/combination-sum/description/)
- [Fair Distribution of Cookies](https://leetcode.com/problems/fair-distribution-of-cookies/description/)
- [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/description/)

Backtracking

#### **Problems**

- Max Num Of Requests
- [Letter combination of phone numbers](https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/)
- [Combinations](https://leetcode.com/problems/combinations/description/)
- [Combination sum II](https://leetcode.com/problems/combination-sum-ii/description/)
- [Subsets](https://leetcode.com/problems/subsets/description/)

Binary Tree

#### **Basic Operations**

- Creation of Binary Tree
- Traversal in trees : PreOrder, Inorder and Postorder
- Number of nodes in tree
- Level Order Traversal Using Queue
- Deleting a binary tree
- Compute the height of the binary tree using recursion.
- Compute the height of the binary tree without recursion.
- Number of leaf nodes in a binary tree.
- [Diameter Of Binary Tree](https://leetcode.com/problems/diameter-of-binary-tree/description/)
- [PreOrder Traversal without recursion](https://leetcode.com/problems/binary-tree-preorder-traversal/description/)
- [Level order traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/description/)
- [Find a Corresponding Node of a Binary Tree in a Clone of That Tree](https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/description/)
- [Deepest Leave Sum](https://leetcode.com/problems/deepest-leaves-sum/description/)
- [To sum tree](https://practice.geeksforgeeks.org/problems/transform-to-sum-tree/1)
- [Boundary Traversal](https://practice.geeksforgeeks.org/problems/boundary-traversal-of-binary-tree/0)
- [Top view](https://www.codingninjas.com/codestudio/problems/top-view-of-the-tree_799401?leftPanelTab=0)
- [Bottom View](https://www.codingninjas.com/codestudio/problems/bottom-view-of-binary-tree_893110?leftPanelTab=0)
- [Diagonal traversal](https://www.codingninjas.com/studio/problems/diagonal-traversal-of-a-binary-tree_920477?leftPanelTab=0)
- [Leaf at same level](https://practice.geeksforgeeks.org/problems/leaf-at-same-level/1)

#### **Problems**

- Mirror of the tree.
- Preorder Traversal Without Recursion.
- Find the maximum element of the binary tree using recursion.
- Find the maximum element of the bianry tree without recursion.
- Algorithm to search an element in a bianry tree.
- Algorithm to search an element in a binary tree without recursion.
- Finding the deepest node in a binary tree.
- Deletion in binary tree.
- Check if two binary trees are structurally identical.
- Find level with max sum.
- Find the sum of all the nodes in a binary tree.
- Check if two binary trees are mirror of each other.
- Print All Ancestors of a node.
- Print right view of the tree using level order traversal
- [Zigzag level order traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/description/)
- [Flatten binary tree to linked list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/description/)
- [Construct string from binary tree(Parethesis)](https://leetcode.com/problems/construct-string-from-binary-tree/description/)
- [Reverse odd levels](https://leetcode.com/problems/reverse-odd-levels-of-binary-tree/description/)
- [Find Elements in a Contaminated Binary Tree](https://leetcode.com/problems/find-elements-in-a-contaminated-binary-tree/description/)
- [Remove leaf nodes with a given value](https://leetcode.com/problems/delete-leaves-with-a-given-value/description/)
- [Evaluate a boolean binary tree](https://leetcode.com/problems/evaluate-boolean-binary-tree/description/)
- [Increasing Order Search Tree](https://leetcode.com/problems/increasing-order-search-tree/description/)
- [Average of levels of binary tree](https://leetcode.com/problems/average-of-levels-in-binary-tree/description/)
- [Leaf similar trees](https://leetcode.com/problems/leaf-similar-trees/description/)
- [Binary Tree tilt](https://leetcode.com/problems/binary-tree-tilt/description/)
- [Find Bottom Left Tree Value](https://leetcode.com/problems/find-bottom-left-tree-value/description/)
- [Has Path Sum](https://leetcode.com/problems/path-sum/description/?envType=study-plan-v2&envId=top-interview-150)
- [Populating Next Right Pointers in Each Node II](https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/description/?envType=study-plan-v2&envId=top-interview-150)
- [Sum of left leaves](https://leetcode.com/problems/sum-of-left-leaves/description/)
- [Binary Trees Max Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/description/)
- [Lowest Common Ancestor](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/description/)
- [Minimum Depth of binary tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/description/)
- [All nodes distance k in binary tree](https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/description/)
- [Count complete tree nodes](https://leetcode.com/problems/count-complete-tree-nodes/description/?envType=study-plan-v2&envId=top-interview-150)
- [Count Nodes Equal to Average of subtree](https://leetcode.com/problems/count-nodes-equal-to-average-of-subtree/description/)

Binary Search Tree

#### **Basic Operations**

- Creating a binary search tree.
- Find the maximum and the minimum element of the binary search tree
- Searching in the binary search tree
- Printing the InOrder Predecessor and Successor of an element.

#### **Problems**

- [Validate BST](https://leetcode.com/problems/validate-binary-search-tree/)
- [Convert Sorted Array to BST](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/)
- [Kth Smallest element in BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/)
- [Mode in BST](https://leetcode.com/problems/find-mode-in-binary-search-tree/description/)
- [Two Sum IV - Input is a BST](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/)
- [Combining elements of two BST in ascending order](https://leetcode.com/problems/all-elements-in-two-binary-search-trees/)
- [Convert BST to Greater Tree](https://leetcode.com/problems/convert-bst-to-greater-tree/description/)
- [Range Sum of BST](https://leetcode.com/problems/range-sum-of-bst/description/)
- [Unique BSTs (catalan numbers)](https://leetcode.com/problems/unique-binary-search-trees/description/)
- [Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/description/?envType=study-plan-v2&envId=top-interview-150)

Graph

#### **Basic programs**

- Creation of adjacency matrix
- Creation of adjacency list
- Using adjacency list to store the weights
- Tranpose of adjacency list
- Breadth first search implementation using queue & adjacency matrix
- Depth first search implementation using stack
- BFS using adjacency list
- DFS using adjacency list
- [Prims Algo](https://www.codingninjas.com/codestudio/problem-details/prim-s-mst_1095633)
- [Detect Cycle in directed graph](https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1)
- [Detect Cycle in directed graph (Using Topological Sort)](https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1)
- [Find the center of Star Graph](https://leetcode.com/problems/find-center-of-star-graph/description/)
- [Dijsktra Algo using priority queue](https://www.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1)
- [Dijsktra Algo using set](https://www.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1)
- [Bellman ford algo](https://www.geeksforgeeks.org/problems/distance-from-the-source-bellman-ford-algorithm/1)
- [Floyd warshall algo](https://www.geeksforgeeks.org/problems/implementing-floyd-warshall2042/1)

#### **Problems**

- Connected Components
- [Number of provinces](https://leetcode.com/problems/number-of-provinces/description/)
- [Number of islands](https://leetcode.com/problems/number-of-islands/description/)
- [Flood Fill](https://leetcode.com/problems/flood-fill/description/)
- [Rotten Oranges](https://leetcode.com/problems/rotting-oranges/description/)
- [Detect a cycle in undirected graph](https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1)
- [01 Matrix (distance to nearest 0)](https://leetcode.com/problems/01-matrix/description/)
- [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/description/)
- [Number of Enclaves](https://leetcode.com/problems/number-of-enclaves/description/)
- [Number of unique islands](https://practice.geeksforgeeks.org/problems/number-of-distinct-islands/1)
- [Eventual Safe State](https://practice.geeksforgeeks.org/problems/eventual-safe-states/1)
- [Topological Sort Using DFS](https://practice.geeksforgeeks.org/problems/topological-sort/1?utm_source=gfg&utm_medium=article&utm_campaign=bottom_sticky_on_article)
- [Topological Sort using Kahns Algo (BFS)](https://practice.geeksforgeeks.org/problems/topological-sort/1?utm_source=gfg&utm_medium=article&utm_campaign=bottom_sticky_on_article)
- [Course Schedule (Topological Sort)](https://leetcode.com/problems/course-schedule/description/)
- [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/description/)
- [Alien Dictionary](https://practice.geeksforgeeks.org/problems/alien-dictionary/1)
- [Shortest Path in Direct Acyclic Graph(toposort approach)](https://practice.geeksforgeeks.org/problems/shortest-path-in-undirected-graph/1)
- [Shortest path in undirected graph having unit distance](https://www.geeksforgeeks.org/problems/shortest-path-in-undirected-graph-having-unit-distance/1)
- [All path from source](https://leetcode.com/problems/all-paths-from-source-to-target/description/)
- [Can Visit All Rooms](https://leetcode.com/problems/keys-and-rooms/description/)
- [Word Search](https://leetcode.com/problems/word-search/description/)
- [Word Ladder](https://leetcode.com/problems/word-ladder/)

Dynamic Programming

- Fibonacci Numbers
- Recursive approach
- Memoization approach
- Dynamic approach
- Space optimized approach
- Catalan Numbers
- Recursive approach
- DP approach
- Binomial coefficient approach
- [Nth Catalan number](https://practice.geeksforgeeks.org/problems/nth-catalan-number0817/1)
- Minimum operations
- [Minimum steps to reach k from 0](https://www.geeksforgeeks.org/minimize-steps-to-reach-k-from-0-by-adding-1-or-doubling-at-each-step/)
- [Minimum steps to reach 0 from k](https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/)
- Coin change
- [Recursive Approach](https://www.geeksforgeeks.org/coin-change-dp-7/)
- [Space Optimized Approach](https://www.geeksforgeeks.org/coin-change-dp-7/)
- Permutations
- [Recursive Approach](https://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/)
- [STL C++ Approach](https://www.geeksforgeeks.org/stdnext_permutation-prev_permutation-c/)
- [Number of ways to cover distance](https://practice.geeksforgeeks.org/problems/count-number-of-hops-1587115620/1?utm_source=gfg&utm_medium=article&utm_campaign=bottom_sticky_on_article)
- [Recursive approach](https://www.geeksforgeeks.org/count-number-of-ways-to-cover-a-distance/)
- [Dynamic approach](https://www.geeksforgeeks.org/count-number-of-ways-to-cover-a-distance/)
- [More efficient approach (using array of 3)](https://www.geeksforgeeks.org/count-number-of-ways-to-cover-a-distance/)
- Longest Common Subsequence
- [Min Insertions and deletions to make strings equal](https://www.geeksforgeeks.org/minimum-number-deletions-insertions-transform-one-string-another/)
- [Longest Common subsequence - leetcode](https://leetcode.com/problems/longest-common-subsequence/description/)
- [Frog Jump](https://www.codingninjas.com/codestudio/problem-details/frog-jump_3621012)
- Recursive approach
- Memoization approach
- Dynamic approach
- Space optimized approach

#### **Problems**

- [Nth Tribonacci Number](https://leetcode.com/problems/n-th-tribonacci-number/description/)
- [Min cost climbing stairs](https://leetcode.com/problems/min-cost-climbing-stairs/description/)
- [Jump Game](https://leetcode.com/problems/jump-game/description/?envType=study-plan-v2&envId=top-interview-150)
- [Factorial Trailing Zeroes](https://leetcode.com/problems/factorial-trailing-zeroes/description/?envType=study-plan-v2&envId=top-interview-150)
- [Put Marbles in Bags](https://leetcode.com/problems/put-marbles-in-bags/description/)

Favorites

- [Find Duplicates](https://leetcode.com/problems/find-all-duplicates-in-an-array/description/)
- [Xor Beauty](https://leetcode.com/problems/find-xor-beauty-of-array/description/)
- ['Verifying an alien dictionary'](https://leetcode.com/problems/verifying-an-alien-dictionary/description/)
- [Zigzag Conversion](https://leetcode.com/problems/zigzag-conversion/description/)
- [Permutations in string](https://leetcode.com/problems/permutation-in-string/description/)
- [Find All Anagrams in a String](https://leetcode.com/problems/find-all-anagrams-in-a-string/description/)
- [Total fruits](https://leetcode.com/problems/fruit-into-baskets/description/)
- [Maximum number of balloons](https://leetcode.com/problems/maximum-number-of-balloons/description/)
- [Jump Game II](https://leetcode.com/problems/jump-game-ii/description/)
- [Naming a company](https://leetcode.com/problems/naming-a-company/description/)
- [As Far from Land as Possible](https://leetcode.com/problems/as-far-from-land-as-possible/description/)
- [Count Odd Numbers in an Interval Range](https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/description/)
- [Replace Elements with Greatest Element on Right Side](https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/description/)
- [Missing Number](https://practice.geeksforgeeks.org/problems/missing-number-in-array1416/1)
- [Max Product Of Subarray](https://leetcode.com/problems/maximum-product-subarray/description/)
- [Boats to save people](https://leetcode.com/problems/boats-to-save-people/description/)
- [Minimize & maximum of array](https://leetcode.com/problems/minimize-maximum-of-array/description/)
- [Teemo Attacking](https://leetcode.com/problems/teemo-attacking/description/)
- [Divisor Game](https://leetcode.com/problems/divisor-game/description/)
- [Sqrt(x)](https://leetcode.com/problems/sqrtx/description/?envType=study-plan-v2&envId=top-interview-150)
- [LRU Cache](https://leetcode.com/problems/lru-cache/description/?envType=study-plan-v2&envId=top-interview-150)
- [First missing positive](https://leetcode.com/problems/first-missing-positive/description/)
- [Frequency of limited range elements](https://practice.geeksforgeeks.org/problems/frequency-of-array-elements-1587115620/1)
- [wo Sum II - Input Array Is Sorted](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/)
- [Excel Sheet Column Number](https://leetcode.com/problems/excel-sheet-column-number/description/)