https://github.com/tanjib-rafi/leetcode
https://github.com/tanjib-rafi/leetcode
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tanjib-rafi/leetcode
- Owner: Tanjib-Rafi
- Created: 2022-01-05T13:45:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-06T18:19:56.000Z (almost 4 years ago)
- Last Synced: 2025-01-04T14:41:46.517Z (about 1 year ago)
- Language: Python
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
If input array is sorted then
- Binary search
- Two pointers
If asked for all permutations/subsets then
- Backtracking
If given a tree then
- DFS
- BFS
If given a graph then
- DFS
- BFS
If given a linked list then
- Two pointers
If recursion is banned then
- Stack
If must solve in-place then
- Swap corresponding values
- Store one or more different values in the same pointer
If asked for maximum/minumum subarray/subset/options then
- Dynamic programming
If asked for top/least K items then
- Heap
If asked for common strings then
- Map
- Trie
Else
- Map/Set for O(1) time & O(n) space
- Sort input for O(nlogn) time and O(1) space