List of Programs related to data structures and algorithms
-
Stack using array: JavaScript
-
Stack using linkedlist: JavaScript
- Queue using array: JavaScript
- Queue using linkedlist: JavaScript
- Queue using stack: JavaScript
- SinglyLinkedlist implementation: Source Playground Documentation
- DoublyLinkedlist implementation: JavaScript
- Binary Search Tree: JavaScript
- Unweighted undirected graph: JavaScript
- HashTable: JavaScript
No. | Name | Source | Live | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Contains duplicates | Source | Playground | Documentation | Easy | Set/Object |
2 | Two sum2- Input array sorted | Source | Playground | Documentation | Medium | Two pointers |
3 | 3 sum | Source | Playground | Documentation | Medium | Two pointers |
4 | Product of array except self | Source | Playground | Documentation | Medium | Prefix and postfix pattern |
5 | Max sum subarray | Source | Playground | Documentation | Medium | Kadane's algorithm |
6 | Minimum size subarray sum | Source | Playground | Documentation | Medium | Sliding window |
7 | Sort Colors | Source | Playground | Documentation | Medium | Two pointers |
8 | Maximum product subarray | Source | Playground | Documentation | Medium | Kadane's algorithm |
9 | Find minimum in rotated sorted array | Source | Playground | Documentation | Medium | Binary search technique |
10 | Maximum Circular subarray | Source | Playground | Documentation | Medium | Kadane's algorithm |
11 | Rotate array | Source | Playground | Documentation | Medium | Two pointers |
12 | Search in rotated sorted array | Source | Playground | Documentation | Medium | Binary search |
13 | Container with most water | Source | Playground | Documentation | Medium | Two pointers |
14 | First missing positive number | Source | JavaScript | Documentation | Hard | In-place hashing |
15 | Best time to buy stock and sell stock | Source | JavaScript | Documentation | Easy | Greedy algorithm |
16 | Two missing numbers | Source | JavaScript | Documentation | Medium | Sum and average calculations |
No. | Name | Source | Live | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Longest substring without repeating characters | Source | JavaScript | Documentation | Medium | Sliding Window |
2 | Longest repeating character replacement | Source | JavaScript | Documentation | Medium | Sliding Window |
3 | Minimum window substring | Source | JavaScript | Documentation | Hard | Sliding Window |
4 | Valid anagram | Source | JavaScript | Documentation | Easy | Frequency counting |
5 | Group anagrams | Source | JavaScript | Documentation | Medium | Frequency counting |
6 | Valid palindrome | Source | JavaScript | Documentation | Easy | Two pointer |
7 | Longest palindromic substring | Source | JavaScript | Documentation | Medium | Expanding around center |
8 | Palindromic substrings | Source | JavaScript | Documentation | Medium | Expanding around center |
9 | Encode and decode strings | Source | JavaScript | Documentation | Medium | Basic string and array operations |
10 | Greatest common devisor of strings | Source | JavaScript | Documentation | Easy | Euclidean and String operations |
11 | Reverse words in string | Source | JavaScript | Documentation | Medium | Basic string and array operations |
No. | Name | Source | Live | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Climbing stairs | Source | JavaScript | Documentation | Medium | Dynamic programming |
2 | Coin change | Source | JavaScript | Documentation | Medium | Dynamic programming |
3 | Longest increasing subsequence | Source | JavaScript | Documentation | Medium | Dynamic programming(Bottom up) |
4 | Longest common subsequence | Source | JavaScript | Documentation | Medium | Two-dimentional bottom up Dynamic programming |
5 | Word break | Source | JavaScript | Source | Medium | Bottom up dynamic programming |
6 | Combination Sum 4 | Source | JavaScript | Documentation | Medium | Bottom up Dynamic programming |
7 | House robber | Source | JavaScript | Documentation | Medium | Fibonacci pattern bottom-up dynamic programming |
8 | House robber 2 | Source | JavaScript | Documentation | Medium | Bottom-up dynamic programming |
9 | Decode ways | Source | JavaScript | Documentation | Medium | Dynamic programming |
10 | Unique paths | Source | JavaScript | Documentation | Medium | Dynamic programming |
11 | Jump game | Source | JavaScript | Documentation | Medium | Dynamic programming or Greedy |
No. | Name | Source | Playground | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Sum of two integers | Source | JavaScript | Documentation | Medium | Bitwise operations |
2 | Number of 1 Bits | Source | JavaScript | Documentation | Easy | Brian Kernighans |
3 | Counting Bits | Source | JavaScript | Documentation | Easy | Dynamic programming |
4 | Missing number | Source | JavaScript | Documentation | Easy | Bitwise XOR |
5 | Reverse Bits | Source | JavaScript | Documentation | Easy | Bitwise operations |
No. | Name | Source | Playground | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Sort Stack | Source | JavaScript | Documentation | Easy | Stack push & pop |
2 | Balanced Brackets | Source | JavaScript | Documentation | Medium | Stack push and pop |
3 | Reverse Polish Notation | Source | JavaScript | Documentation | Medium | Stack push & pop |
4 | Daily Temperatures | Source | JavaScript | Documentation | Medium | Monotonic decreasing stack |
5 | Number of People See In Queue | Source | JavaScript | Documentation | Medium | Monotonic decreasing stack |
-
Reverse substring: JavaScript
-
Detect cycle in a linkedlist: JavaScript
-
Merge two sorted lists: JavaScript
-
Merge K sorted lists: JavaScript
-
Remove Nth node from end of list: JavaScript
-
Reorder list: JavaScript
-
Find middle node: JavaScript
-
Find Kth node from end of list: JavaScript
-
Partition list: JavaScript
-
Remove duplicates: JavaScript
-
Binary to decimal: JavaScript
-
Swap first and last: JavaScript
-
Palindrome check: JavaScript
-
Swap node pairs: JavaScript
-
Maximum depth of binary tree: JavaScript
-
Same tree: JavaScript
-
Invert or Flip binary tree: JavaScript
-
Binary tree maximum path sum: JavaScript
-
Binary tree level order traversal: JavaScript
-
Serialize and deserialize binary tree: JavaScript
-
Subtree of another tree: JavaScript
-
Construct binary tree from preorder and inorder traversal: JavaScript
-
Validate BST: JavaScript
-
Kth smalleest element in BST: JavaScript
-
Lowest Common Ancestor of BST: JavaScript
-
Trie: JavaScript
-
Design and Search words Datastructure: JavaScript
-
Word search 2: JavaScript
-
Clone graph: JavaScript
-
Course schedule: JavaScript
-
Pacific Atlantic waterflow: JavaScript
-
Number of Islands: JavaScript
-
Longest consecutive sequence: JavaScript
-
Alien dictionary: JavaScript
-
Graph valid tree: JavaScript
-
Number of connected components in an undirected graph: JavaScript
-
Set matrix zeros: JavaScript
-
Spiral matrix: JavaScript
-
Rotate image: JavaScript
-
Word search: JavaScript
No. | Name | Source | Live | Documentation | Level | Pattern |
---|---|---|---|---|---|---|
1 | Insert interval | Source | JavaScript | Documentation | Medium | Basic math operations |
2 | Merge interval | Source | JavaScript | Documentation | Medium | Sorting and basic math operations |
3 | Non-overlapping intervals | Source | JavaScript | Documentation | Medium | Greedy and basic math operations |
4 | Meeting rooms | Source | JavaScript | Documentation | Medium | Greedy and basic math operations |
5 | Meeting rooms 2 | Source | JavaScript | Documentation | Medium | Two pointers |
-
Duplicates: JavaScript
-
Two sum: JavaScript Documentation
-
First non repeating character: JavaScript
-
Group anagram: JavaScript
-
Verify Common Elements: JavaScript
No. | Name | Source | Playground | Documentation | Level | Complexity |
---|---|---|---|---|---|---|
1 | Bubble sort | Source | JavaScript | Documentation | Easy | TC: O(n2), SC: O(1) |
2 | Selection sort | Source | JavaScript | Documentation | Easy | TC: O(n2), SC: O(1) |
3 | Insertion sort | Source | JavaScript | Documentation | Easy | TC: O(n2), SC: O(1) |
4 | Merge sort | Source | JavaScript | Documentation | Medium | TC: O(n log(n)), SC: O(n) |
5 | Quick sort | Source | JavaScript | Documentation | Medium | TC: O(n2), SC: O(log n) |
6 | Heap sort | Source | JavaScript | Documentation | Hard | TC: O(n log(n)), SC: O(1) |