Standard Algorithms Flashcards
1
Q
bubble sort
A
2
Q
binary search
A
If Q asks for binary search function that is within a list that’s been passed into a procedure then add RETURNS INTEGER to end of first line and RETURN
3
Q
quicksort
A
4
Q
insertion sort
A
5
Q
find maximum
A
6
Q
find minimum
A
7
Q
(higher) counting occurences
A
- 1 occurrences = 0
- 2 take in value to find
- 3 for each item
- 4 if current item = value to find then
- 5 occurrences = occurrences + 1
- 6 end if
- 7 next item in list
- 8 display occurrences
8
Q
(higher) linear search
A
- 1 ask user for value to find
- 2 take in value to find
- 3 found = false
- 4 do
- 5 if current item = value to find then
- 6 found = true
- 7 position = current item position in list
- 8 end if
- 9 loop until (found=true) or (end of list)