read
알고리즘 스터디
알고리즘 유형별로 정리된 사이트를 이용해서 공부하자!
1. https://www.geeksforgeeks.org/top-10-algorithms-in-interview-questions/
8가지 주제에 대해 배우기 좋은 Top 10 문제들을 뽑아놨다.
1. Graph
- BFS
- DFS
- Dijkstra
- Floyd Warshall
- Union Find
- Prim
- Kruskal
- Topological Sort
- Boggle
- Bridges
2. Linked List
- Insertion
- Delete
- Compare two strings
- Add Two Numbers
- Merge
- Reverse
- Union and Intersection
- Detect and Remove Loop
- Merge Sort
- Select random node
3. Dynamic Programming
- Longest Common Subsequence
- Longest Increasing Subsequence
- Edit Distance
- Minimum Partition
- Cover Distance
- Longest Path in Matrix
- Subset Sum Problem
- Optimal Strategy
- 0-1 Knapsack Problem
- Boolean Parenthesization Problem
4. Sorting and Searching
- Binary Search
- Searing in sorted, rotated array
- Bubble Sort
- Insertion Sort
- Merge Sort
- Heap Sort(Binary Heap)
- Quick Sort
- Interpolation Search
- Find Kth Smallest/Largest Element in Unsorted Array
- Given sorted array and x, find the pair whose sum is closest to x
5. Tree/ Binary Search Tree
- Find Minumum Depth of a Binary Tree
- Maximum Path Sum in a Binary Tree
- Preorder Traversal of BST
- check full binary tree or not
- Bottom view Binary Tree
- Top view Binary Tree
- Remove nodes on root to leaf paths of length < K
- Lowest Common Ancestor in BST
- Check binary tree is subtree of another binary tree
- reverse alternate levels of a perfect binary tree
6. Number Theory
- Modular Exponentiation
- Modular multiplicative inverse
-
Primality Test Set 2 (Fermat Method) - Euler’s Totient Function
- Sieve of Eratosthenes
- Convex Hull
- Basic and Extended Euclidean algorithms
- Segmented Sieve
- Chinese remainder theorem
- Lucas Theorem
7. BIT Manipulation
- Maximum Subarray XOR
- Magic Number
- Sum of bit differences among all pairs
- Swap All Odds And Even Bits
- Find the element that appears once
- Binary representation of a given number
- Count total set bits in all numbers from 1 to n
- Rotate bits of a number
- Count number of bits to be flipped to convert A to B
- Find Next Sparse Number
8. String / Array
- Reverse an array without affecting special characters
- All Possible Palindromic Partitions
- Count triplets with sum smaller than a given value
- Convert array into Zig-Zag fashion
- Generate all possible sorted arrays from alternate elements of two given sorted arrays
- Pythagorean Triplet in an array
- Length of the largest subarray with contiguous elements
- Find the smallest positive integer value that cannot be represented as sum of any subset of a given array
- Smallest subarray with sum greater than a given value
- Stock Buy Sell to Maximize Profit
1번, 3번 주제와 Binary Tree 와 관련된 4번, 5번 주제에 집중해서 공부해야 겠다.
2. https://programmers.co.kr/learn/challenges?tab=practice_kit
- 해시
- 스택/큐
- 힙
- 정렬
- 완전탐색
- 그리디
- DP
- DFS/BFS
- BST
- Graph
프로그래머스는 깔끔하게 잘 정리되어 있다.
6번부터는 좀 더 공부해야 한다.