Data Structures Quiz Flashcards

1
Q

__________ is the process of arranging a list of items into a defined order based on some criteria.

A

Sorting

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

What type does “compareTo” return?

A

Int

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

Which of these have the smallest time complexity?

A

Quick Sort

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

_______ orders a list of values by repetitively comparing neighboring elements and swapping their positions if necessary.

A

Bubble Sort

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

The _____ sort algorithm sorts a list by recursively dividing the list in half until each sub-list has one element and then merging these sub-lists into the sorted order.

A

Merge Sort

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

This type of sequential sort algorithm sorts a list by repeatedly placing the next smallest element into its final sorted position.

A

Selection Sort

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

The best comparison sort in terms of order is:

A

O(nlog(n))

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

the _____ method starts by repeatedly splitting the list in half?

A

Merge Sort

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

What is the time complexity of a Quick sort?

A

nlogn

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

Merge Sort has time complexity O(___).

A

nlogn

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

After one pass on the numbers ( 5 3 9 5 ), what would be the result if you were to use
Bubble Sort?

A

3 5 5 9

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

What sorting algorithm has the largest worst-case time complexity?

A

Quick Sort

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

the _______ sort divides the array into a sorted and an unsorted region, and iteratively shrinks the unsorted region by picking its first element and inserting it into the correct position in the sorted region

A

Insertion Sort

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