Fundamentals of algorithms Flashcards

1
Q

How does linear search work?

A

Searches throughout the array one by one

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

How does binary search work?

A

in chronological order, we split the array in half and if the number is smaller than the initial value we disregard that set and repeat until we find the value

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

How does merge sort work?

A
  • Split array into halves and then quarters
  • Split until it cannot be divided
  • combine together from 2’s to 4’s and swap if values are bigger until in chronological order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does bubble sort work?

A

go through two elements at a time and swap if number is smaller until in chronological order.

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