Standard Algorithms Flashcards

1
Q

bubble sort

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

quicksort

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

insertion sort

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

find maximum

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

find minimum

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(higher) counting occurences

A
  1. 1 occurrences = 0
  2. 2 take in value to find
  3. 3 for each item
  4. 4 if current item = value to find then
  5. 5 occurrences = occurrences + 1
  6. 6 end if
  7. 7 next item in list
  8. 8 display occurrences
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

(higher) linear search

A
  1. 1 ask user for value to find
  2. 2 take in value to find
  3. 3 found = false
  4. 4 do
  5. 5 if current item = value to find then
  6. 6 found = true
  7. 7 position = current item position in list
  8. 8 end if
  9. 9 loop until (found=true) or (end of list)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly