티스토리 뷰

1. Constant time complexity
constant time algorithm: regardless of input size, number of steps are determined.
time complexity = O(1), O(2), …

2. Linear time complexity
linear search algorithm has a time complexity of O(N)
time complexity = O(N)
N: number of inputs
linear search algorithm: time complexity = O(N)

3. Quadratic time complexity (2차 시간)
- happens when a function has nested loops(중첩 반복. ex. 중첩된 for문 등)
- time complexity = O(N^2)


4. Logarithmic Time Complexity (로그 시간)
- used to express speed of binary search
- time complexity = O(log N)
- logarithm(로그) <-> exponent(지수)
- 로그의 밑은 기재하지 않음
-

'data structure' 카테고리의 다른 글

Sort  (0) 2022.01.19
Search Algorithms (Binary Search/ Linear Search)  (0) 2022.01.19
Array  (0) 2022.01.19
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함