Constraints - Input | Worst Time Complexity
n β€ 12 | O(n!)
n β€ 25 | O(2^n)
n β€ 100 | O(n^4)
n β€ 500 | O(n^3)
n β€ 10^4 | O(n^2)
n β€ 10^6 | O(n log n)
n β€ 10^8 | O(n)
n > 10^8 | O(log n) or O(1)
-
-
Reverse Array
-
delete an element from the array
- linear search
- binary search
- hashing
-
search element in the array
-
insert an element in array
-
sort the array
- insertion sort
- selection sort
- bubble sort
- merge sort
- quick sort
- heap sort
- count sort
- tree sort
-
find min and max elements
-
find maximum subarray sum
-
find first max element
-
find second max element
-
find kth smallest element
-
find kth largest element
-
sort array of 0,1,2
-
find duplicates in array or print duplicates
-
remove duplicates
-
-
- print string
- reverse string
- reverse string by words
- check weather string is anagram or not
-
- implement single linked list
- implement double linked list
- implement circluler linked list
- insert node in ll
- search node in ll
- delete node in ll
- find length of the list
- find middle node of list
- revese linked list
-
- Binary Tree
- Binary Search Tree
- AVL Tree (Self Balanced Binary Search Tree)
- Red Black Tree
-
1. Undirected 2. Directed
-
1. Cyclic 2. Acyclic
-
1. Adjacency Matrix 2. Adjacency List
-
Directed acyclic graph
-
- 01 Knapsack
- Fibbonaci series
- Largest common subsequence
- Longest increasing subsequence
Lokesh singh
200 medium problems solved 27th march 2024. now target for next 100 medium problems.