A simple sorting algorithm like selection sort or bubble sort-03358
A simple sorting algorithm like selection sort or bubble sort have a wrost case of
This multiple choice question (MCQ) is related to the book/course vu cs301 Data Structures. It can also be found in vu cs301 Final Term - Quiz No.6.
A simple sorting algorithm like selection sort or bubble sort have a wrost case of
O(1) time because all lists take the same amount of time to sort
O(n) time because it has to perform n swaps to order the list.
O(n2 ) time because sorting 1 element takes O(n) time - After 1 pass through the list, either of thesealgorithms can guarantee that 1 element is sorted.
O(n3 ) time, because the worst case has really random input which takes longer to sort.