Algorithm and Data Structure Flashcards
Give time and space complexity of quick sort.
Best: omega( n logn )
Average: theta( n logn )
Worst: O( n^2 )
Give time and space complexity of bubble sort.
Best: omega( n )
Average: theta( n^2 )
Worst: O( n^2 )
Give time and space complexity of merge sort.
Best: omega( n logn )
Average: theta( n logn )
Worst: O( n logn )
Give time and space complexity of insertion sort.
Best: omega( n )
Average: theta( n^2 )
Worst: O( n^2 )
Give time and space complexity of selection sort.
Best: omega( n^2 )
Average: theta( n^2 )
Worst: O( n^2 )
Give time and space complexity of heap sort.
Best: omega( n logn )
Average: theta( n logn )
Worst: O( n logn )
Give time and space complexity of radix sort.
Best: omega( nk )
Average: theta( nk )
Worst: O( nk )
where k is the range of input values.
Give time and space complexity of bucket sort.
Best: omega( n+k )
Average: theta( n+k )
Worst: O( n^2 )
where k is the range of input values.