Algorithm and Data Structure Flashcards

1
Q

Give time and space complexity of quick sort.

A

Best: omega( n logn )
Average: theta( n logn )
Worst: O( n^2 )

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

Give time and space complexity of bubble sort.

A

Best: omega( n )
Average: theta( n^2 )
Worst: O( n^2 )

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

Give time and space complexity of merge sort.

A

Best: omega( n logn )
Average: theta( n logn )
Worst: O( n logn )

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

Give time and space complexity of insertion sort.

A

Best: omega( n )
Average: theta( n^2 )
Worst: O( n^2 )

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

Give time and space complexity of selection sort.

A

Best: omega( n^2 )
Average: theta( n^2 )
Worst: O( n^2 )

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

Give time and space complexity of heap sort.

A

Best: omega( n logn )
Average: theta( n logn )
Worst: O( n logn )

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

Give time and space complexity of radix sort.

A

Best: omega( nk )
Average: theta( nk )
Worst: O( nk )

where k is the range of input values.

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

Give time and space complexity of bucket sort.

A

Best: omega( n+k )
Average: theta( n+k )
Worst: O( n^2 )

where k is the range of input values.

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