Computer Science, asked by anushabp19, 6 hours ago

Rearrange following numbers using quick sort:
10, 6, 3, 7, 17, 26, 56, 32, 72​

Answers

Answered by StarlightPhoenix
6

Answer:

3,6,7,10,17,26,32,56,72

in ascending order

Answered by KailashHarjo
0

The sorted list would be [3, 6, 7, 10, 17, 26, 32, 56, 72].

  • Quicksort is a highly efficient sorting technique that divides a large data array into smaller ones. A vast array is divided into two arrays, one containing values smaller than the provided value, say pivot, on which the partition is based.
  • The QuickSort algorithm is a divide-and-conquer algorithm for sorting an array or list of elements. Here's one possible way to rearrange the numbers using QuickSort:
  • Choose a pivot element from the list, for example, 10.
  • Partition the list into two sublists. Elements less than the pivot are put in one sublist, and elements greater than the pivot are put in another sublist. In this case, the sublists would be [3, 6, 7] and [17, 26, 32, 56, 72].
  • Repeat the process for both sublists until all elements in the sublists are sorted.
  • Finally, concatenate the sublists to get the sorted list.

#SPJ3

Similar questions