CS 3.4. (ALEVEL) -Searching algorithms Flashcards
(3 cards)
Linear search
- conducted on any unordered list
- time complexity of O(N)
- simple to code
-each item is compared sequentially to target
Binary search
-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
Binary Tree search
- 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)