Searching algorithms Flashcards

1
Q

linear search

A
  • start at array[0] and move sequentially throught the array until elementFound == true and return index of element in array
  • In Big O, linear search is to the order of n. O(n) (not efficient)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

O(1)

A
  • an algorithm that always executes in the same time (or space) regardless of size of input data set
  • eg accessing an element in an array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly