1 sort a list of distinct numbers in ascending


(1) Sort a list of distinct numbers in ascending order, using the following divide- and-conquer strategy (Quicksort): divide the list of numbers into two lists: one that contains all items that are strictly smaller than the ?rst item (often called the pivot), and another with all those items that are strictly larger than the ?rst item. Then the two smaller lists are sorted using the same procedure. Once the two lists are sorted, the pieces are juxtaposed. For example, given (11 8 14 7) the pivot is 11. We make two lists, (8 7) and (14). The second is already sorted; sorting the ?rst - pivot is 8 - yields (7 8). Putting the three pieces together: (7 8) 11 (14) ==> (7 8 11 14).

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: 1 sort a list of distinct numbers in ascending
Reference No:- TGS0220808

Expected delivery within 24 Hours