Prog1
The implementation of a simple but efficient randomized algorithm
for finding the ith order statistic, using divide and conquer.
Definition 1. The ith order statistic of an array A of n numbers is (1) the ith smallest number
in A, if i n; or (2) not defined, otherwise.
Note that the given array A is arbitrary and may not be sorted. Also, array A may or may not
have duplicates in its member elements. Below are a few examples:
The first order statistic of A[5, 4, 2, 7] is 2, because 2 the smallest number in the array A.
Obviously the first order statistic is just the minimum of all the array elements.
The nth order statistic of an array A[0..n 1] is just the maximum of all the array elements.
Both the third and the fourth order statistics of A[5, 2, 4, 7, 4, 1] are the number 4, because 4
the third as well as the fourth smallest number in the array A.
The seventh order statistic of A[5, 2, 4, 7, 4, 1] does not exist, because array A has only 6
numbers.
You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.
Latest completed orders:
# | topic title | discipline | academic level | pages | delivered |
---|---|---|---|---|---|
6
|
Writer's choice
|
Business
|
University
|
2
|
1 hour 32 min
|
7
|
Wise Approach to
|
Philosophy
|
College
|
2
|
2 hours 19 min
|
8
|
1980's and 1990
|
History
|
College
|
3
|
2 hours 20 min
|
9
|
pick the best topic
|
Finance
|
School
|
2
|
2 hours 27 min
|
10
|
finance for leisure
|
Finance
|
University
|
12
|
2 hours 36 min
|