1
GATE CSE 2016 Set 2
Numerical
+2
-0
A complete binary min-heap is made by including each integer in $$[1,1023]$$ exactly once. The depth of a node in the heap is the length of the path from the root of the heap to that node. Thus, the root is at depth $$0.$$ The maximum depth at which integer $$9$$ can appear is ___________.
Your input ____
2
GATE CSE 2016 Set 1
MCQ (Single Correct Answer)
+2
-0.6
An operator $$delete(i)$$ for a binary heap data structure is to be designed to delete the item in the $$i$$-th node. Assume that the heap is implemented in an array and i refers to the $$i$$-th index of the array. If the heap tree has depth $$d$$ (number of edges on the path from the root to the farthest leaf), then what is the time complexity to re-fix the heap efficiently after the removal of the element?
A
$$O\left( 1 \right)$$
B
$$O\left( d \right)$$ but not $$O\left( 1 \right)$$
C
$$O\left( {{2^d}} \right)$$ but not $$O\left( d \right)$$
D
$$O\left( {d{2^d}} \right)$$ but not $$O\left( {{2^d}} \right)$$
3
GATE CSE 2015 Set 1
MCQ (Single Correct Answer)
+2
-0.6
Consider a max heap, represented by the array: 40, 30, 20, 10, 15, 16, 17, 8, 4.
Array Index 1 2 3 4 5 6 7 8 9
Value 40 30 20 10 15 16 17 8 4

Now consider that a value 35 is inserted into this heap. After insertion, the new heap is

A
40, 30, 20, 10, 15, 16, 17, 8, 4, 35
B
40, 35, 20, 10, 30, 16, 17, 8, 4, 15
C
40, 30, 20, 10, 35, 16, 17, 8, 4, 15
D
40, 35, 20, 10, 15, 16, 17, 8, 4, 30
4
GATE CSE 2015 Set 2
MCQ (Single Correct Answer)
+2
-0.6
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.
int kth_smallest (int a[], int n, int k)
{
    int left_end = partition (a, n);
    if (left_end+1==k) {
        return a[left_end];
    }
    if (left_end+1 > k) {
        return kth_smallest (___________);
    } else {
        return kth_smallest (___________);   
    }
}
The missing arguments 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)
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12