CS 3.4. (ALEVEL) -Searching algorithms Flashcards
(3 cards)
1
Q
Linear search
A
- conducted on any unordered list
- time complexity of O(N)
- simple to code
-each item is compared sequentially to target
2
Q
Binary search
A
-used on any ordered list
-looks at midpoint and determines if target is higher and lower, and halves the list until it finds it
- time complexity of O(logN) because list is halved each search
3
Q
Binary Tree search
A
- same as binary search but on a binary tree starting at root node and either going left or right of tree
- time complexity of O(logN)