A repository to store my solutions to various problems from LeetCode, CodeForces and other programming problem websites.
Under Construction
No. |
Name |
Link |
Time Complexity |
Space Complexity |
1 |
Linear Search |
Python |
O(n) |
O(1) |
2 |
Binary Search |
Python |
O(log(n)) |
O(1) |
3 |
Recursive Binary Search |
Python |
O(log(n)) |
O(log(n)) |
No. |
Name |
Link |
Time Complexity |
Space Complexity |
1 |
Bubble Sort |
Python |
O(n^2) |
O(1) |
2 |
Selection Sort |
Python |
O(n^2) |
O(1) |
3 |
Insertion Sort |
Python |
O(n^2) |
O(1) |
4 |
Merge Sort |
Python |
O(n*log(n)) |
O(n) |
No. |
Problem |
Link |
Time Complexity |
Space Complexity |
LC-1 |
Two Sum |
Python |
O(n) |
O(n) |
LC-2 |
Add Two Numbers |
Python |
O(max(m,n)) |
O(max(m,n)) |
LC-3 |
Longest Substring Without Repeating Characters |
Python |
O(n) |
O(n) (Sliding Window) |
LC-9 |
Palindrome Number |
Python |
O(log(n)) |
O(1) |
LC-21 |
Merge Two Sorted Lists |
Python |
O(n) |
O(1) |
LC-35 |
Search Insert Element |
Python |
O(log(n)) |
O(1) |
LC-69 |
Sqrt(x) |
Python |
O(log(n)) |
O(1) |
LC-162 |
Find Peak Element |
Python |
O(log(n)) |
O(1) |
LC-167 |
Two Sum II - Input array is sorted |
Python |
O(n) |
O(1) |
LC-198 |
House Robber |
Python |
O(n) |
O(n) |
LC-209 |
Minimum Size Subarray Sum |
Python |
O(n) |
O(1) |
LC-226 |
Invert Binary Tree |
Python |
O(n) |
O(n) |
LC-278 |
First Bad Problem |
Python |
O(log(n)) |
O(1) |
LC-367 |
Valid Perfect Square |
Python |
O(log(n)) |
O(1) |
LC-374 |
Guess Number Higher or Lower |
Python |
O(log(n)) |
O(1) |
LC-441 |
Arranging Coins |
Python |
O(log(n)) |
O(1) |
LC-704 |
Binary Search |
Python |
O(log(n)) |
O(1) |
LC-876 |
Middle of the Linked List |
Python |
O(n) |
O(1) |
LC-1290 |
Convert Binary Number in a Linked List to Integer |
Python |
O(n) |
O(1) |