What sorting algorithm is implemented by the following function?
public class another {
public void sort(int arr[], int begin, int end) {
if (begin < end) {
int partitionIndex = partition(arr, begin, end);
sort(arr, begin, partitionIndex-1);
sort(arr, partitionIndex+1, end);
}
}
}
a. Quick sort
b. Bubble Sort
c. Merge sort
d. Selection sort
a. Quick sort
This is an implementation of the quick sort algorithm. Quick sort is a divide-and-conquer algorithm. It first divides a large array into two smaller subarrays: the low elements and the high elements. It then recursively sorts the subarrays.
You might also like to view...
The disk addresses of the blocks associated with a single ordinary UNIX file are listed in a(n) __________.
a. i-list b. i-node c. i-number d. super block
Disable PHP from opening files via fopen() and FTP by editing:
a. php.ini b. fopen.ini c. fopen.bin d. php.bin
________ is a feature in Excel that can often perform the same tasks as the PROPER and CONCATENATE functions
Fill in the blank(s) with correct word
A virtual private network is
A) Used to connect a television to another mobile technology device B) Used to connect a number of computers to a mainframe C) Used to connect only one device to several other technological devices D) Used to connect one device to another device through a public network such as the Internet