simple sorting algorithm like selection sort or bubble sort has a worst-case of?

(A) O(1) time because all lists take the same amount of time to sort
(B) O(n) time because it has to perform n swaps to order the list
(C) O(n2) time because sorting 1 element takes O(n) time – After 1 pass through the list, either of these algorithms can guarantee that 1 element is sorted
(D) O(n3) time, because the worst case has really random input which takes longer to sort

»Important Links:

Latest Jobs in PakistanGovt Jobs in PakistanPrivate Jobs in Pakistan
NTS JobsPPSC JobsFPSC Jobs
Teaching JobsNADRA JobsBank Jobs
English McqsGeneral Knowledge McqsPak Studies Mcqs
Current Affairs McqsCurrent Affairs Mcqs PDFCurrent Affairs of Pakistan
Books PDFNotes PDFIslamic Studies Mcqs

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!