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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly