Computer Sciences > GATE 2015 SET-2 > C
Suppose you are provided with the following function declaration in the C programming language.
int partition(int a, int n);
The function treats the first element of a as a pivot, and rearranges the array so that all elements less than or equal to the pivot is in the left part of the array, and all elements greater than the pivot is in the right part. In addition, it moves the pivot so that the pivot is the last element of the left part. The return value is the number of elements in the left part.
The following partially given function in the C programming language is used to find the kth smallest element in an array a of size n using the partition function. We assume k ≤ n.
The missing argument lists are respectively
A
(a, left_end, k) and (a + left_end + 1, n - left_end - 1, k - left_end - 1)
B
(a, left_end, k) and (a, n - left_end - 1, k - left_end - 1)
C
(a + left_end + 1, n - left_end - 1, k - left_end - 1) and (a, left_end, k)
D
(a, n - left_end - 1, k - left_end - 1) and (a, left_end, k)

Correct : a

Similar Questions

Consider the following ANSI C program: int main() { Integer x; return 0; } Which one of the following phases in a seven-phase C compiler will throw an erro...
#1068 MCQ
Consider the following ANSI C program. What is the output of the above program?
#1075 MCQ
Consider the following ANSI C function: The value returned by SomeFunction(15, 255) is _______.
#1088 Fill in the Blanks

Related Topics

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......