DFS & BFS
✅ DFS Depth First Search stack, recursion visit all the depth before going onto next branch edge-based technique ⭐️ Keyword subset(부분집합) ✅ Time complexity Adjacency Matrix: O(V^2) ...
✅ DFS Depth First Search stack, recursion visit all the depth before going onto next branch edge-based technique ⭐️ Keyword subset(부분집합) ✅ Time complexity Adjacency Matrix: O(V^2) ...
✔️ Adjacency Matrix, Adjacency List //input 1 2 1 3 1 4 2 4 3 4 0 1 2 3 4 1 0 1 1 1 2 1 0 0 1 3 1 0 0 1 4 1 1 1 0 time complexity low matrix caculation possible if the graph has node ⬆️...
✅ Hash Table Data structure used to insert, look up, remove key-value pairs operates on hashing concept ✔️ Hash function function to change input into keys ⭐️ Keyword ✅ Code input,...
✅ Counting Sort non-comparison-based sorting algorithm counting: how many times does this element appear in input array? input array get the biggest number max count array size: max +...
✅ Radix Sort sorts elements by processing them digit by digit. ⭐️ Keyword integers, strings with fixed-size keys ⭐️ MSD, LSD MSD Most Significant Digit counting from biggest digit ...
✅ Heap Sort Complete Binary Tree binary tree that adds from left 최댓값부터 또는 최솟값부터 정렬 전체 정렬하기 ❌ 가장 큰 값 몇 개만 필요할 때 Build complete binary tree from array Convert array into heap da...
✅ Merge Sort Divide and Conquer Divide: divide the array into two sub arrays Conquer: each subarray sorted Merge: merge back together when merging, since two sub arrays are sorted, ca...
✅ Quick Sort divide and conquer 분할 정복 ⭐️ pivot Choose a Pivot: select pivot element from array Divide(Partitioning): divide the array into two sub arrays front of pivot:...
✅ Selection Sort Select index: place to put the element is fixed(the front) decide which element to put(the smallest) first find the minimum element and place the minimum element at the beg...
✅ Insertion Sort Insert the element in the correct index start from index 2, sort the elements before index if the element is not bigger than tmp, insert the element and break the for l...