Sorting Algorithms Flashcards

1
Q

What is the functionality of Selection sort

A

Move the smallest value to the start.

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

What is the functionality of bubble sort

A

Move the largest value to the end using pair wise comparosons and swapping

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

What is the functionality of Insertion Sort

A

The Array is virtually splitted into 2 parts, Values from the unsorted part is picked and placed at the correct position of the sorted part.

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

What is the functionality of Merge Sort

A

Merge method merges 2 sorted arrays and produce one sorted array, using the divide and conquer stradegy

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

What is the Time complexity of Merge Sort

A

N log N

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

What is the Time complexity of Insertion sort

A

log N

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

What is the Time complexity of Bubble sort and Selection Sort

A

N ^ 2

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

The Step by Step process of Merge Sort

A
  • Divide the unsorted collection into 2
  • Keep on dividing until the sub arrays only contain 1 element
  • Merge the sub problemm solutions together.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly