Algorithms: Search, Sort, ….
Linear Search
- check from index 0
- linear time complexity: as input size grows, running time also increase in a linear way
Binary Search
- only works on sorted array
- sorted array: items on an array are sorted. adding items on a sorted array takes more time than one that is not
- searching process starts from the middle of the array
'data structure' 카테고리의 다른 글
Sort (0) | 2022.01.19 |
---|---|
Type of Time Complexity (Big O notation) (0) | 2022.01.19 |
Array (0) | 2022.01.19 |