algorithms Flashcards

1
Q

Define linear search

A

A sequence that checks every item in a list 1 by 1 until it finds the desired item.

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

Define bubble sort

A

Bubble sort makes multiple passes through a list. It compares items and changes those that are out of order. Each pass through the list places the next largest value in its proper place.

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

Define binary search

A

A sequence that finds the desired item of a list according to the midpoints.

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

Define insertion sort

A

A more efficient version of bubble sort. Each pass would insert each number into its correct place.

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

How are numbers sorted in insertion sort?

A

Compares 1st 2 items and inserts the necessary item into its complete correct position rather than swapping them. Has 2 lists, unsorted and sorted.

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