expand icon
book ADTs, Data Structures, and Problem Solving with C++ 2nd Edition by Larry Nyhoff cover

ADTs, Data Structures, and Problem Solving with C++ 2nd Edition by Larry Nyhoff

النسخة 2الرقم المعياري الدولي: 978-0131409095
book ADTs, Data Structures, and Problem Solving with C++ 2nd Edition by Larry Nyhoff cover

ADTs, Data Structures, and Problem Solving with C++ 2nd Edition by Larry Nyhoff

النسخة 2الرقم المعياري الدولي: 978-0131409095
تمرين 4
The basic operation in the simple selection sort algorithm is to scan a list x 1 ,…, x n to locate the smallest element and to position it at the beginning of the list. A variation of this approach is to locate both the smallest and the largest elements while scanning the list and to position them at the beginning and the end of the list, respectively. On the next scan this process is repeated for the sublist x 2 ,…, x n ? 1 , and so on.
a. Using the array x in Exercise 1, show x after the first two passes of this double-ended simple selection sort.
b. Write a function to implement this double-ended simple selection sort.
c. Determine its computing time.
التوضيح
موثّق
like image
like image

a)
Consider the array "x" given in Exer...

close menu
ADTs, Data Structures, and Problem Solving with C++ 2nd Edition by Larry Nyhoff
cross icon