Back to marketplace

Search algorithms

No description yet. This curated deck is ready for daily study.

Total cards: 24•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (24)

#1
Front (Question)

linear search algorithm

Back (Answer)

traverse the list using a for loop compare each item to the search term if there is no match it is not in the list

#2
Front (Question)

big - O complexity of the linear search

Back (Answer)

O(n) num operations directly proportional to num items in the list

#3
Front (Question)

returned value of linear search function

Back (Answer)

boolean - True or False

#4
Front (Question)

linear search benefits and limitations

Back (Answer)

linear search can be used on any list, but takes more operations than binary search

#5
Front (Question)

binary search

Back (Answer)

find midpoint compare to search term discard half of the list where the search term is not found repeat until found or list is down to one item

#6
Front (Question)

Big- O complexity of binary search

Back (Answer)

O(log n)

#7
Front (Question)

two ways of implementing binary search

Back (Answer)

• slicing list into smaller list • using “start” and “stop” markers to mark the ara of the list where the search term might occur

#8
Front (Question)

benefits and limitations of binary search

Back (Answer)

• faster than linear search • can only be used with an ordered list

#9
Front (Question)

five levels of big O complexity in order

Back (Answer)

constant - O(1) logarithmic - O(log n) linear - O(n) polynomial- O(n^x) exponential - O(x^n)

#10
Front (Question)

how to define the complexity of an algorithm

Back (Answer)

constant - no loop logarithmic- dividing a list in half repeatedly linear - a for loop polynomial - a loop inside a loop exponential - an even more complex program

#11
Front (Question)

how to determine the complexity of an expression

Back (Answer)

Ignore the actual numbers Look for any places where n occurs in the expression Compare this to the big-O levels to find a match to the shape If there is more than one example, take the most complex

#12
Front (Question)

two ways to swap values

Back (Answer)

tuple substitution three- line swap using a “temp” variable

#13
Front (Question)

bubble sort

Back (Answer)

traverse list compare each value to the next, swap if wrong way around traverse multiple times until there are no swaps

#14
Front (Question)

how to recognise bubble sort

Back (Answer)

a for loop inside a while loop

#15
Front (Question)

big- O complexity of bubble sort

Back (Answer)

polynomial O(n^x)

#16
Front (Question)

evaluate bubble sort

Back (Answer)

very slow avoid using unless list is short

#17
Front (Question)

insertion sort

Back (Answer)

traverse list once compare value at marker to one before it if smaller, pass all the way back and insert it in its correct position

#18
Front (Question)

how to recognise insertion sort

Back (Answer)

for loop with a backwards for loop inside it

#19
Front (Question)

big O complexity of insertion sort

Back (Answer)

polynomial O(n^x)

#20
Front (Question)

evaluate insertion sort

Back (Answer)

usually faster than bubble sort works well to tidy up list which is almost sorted

#21
Front (Question)

merge sort

Back (Answer)

split list into many small lists of one marge to make sorted lists of two continue to merge until one sorted list

#22
Front (Question)

how to recognise merge sort

Back (Answer)

two functions - one to split the list plus a merge function

#23
Front (Question)

merge sort complexity

Back (Answer)

O ( n x logn )

#24
Front (Question)

evaluate merge sort

Back (Answer)

fast and reliable takes up more space in memory than other sorts