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)
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