What does it mean when we say that an algorithm X is asymptotically more efficient than Y?
The auxiliary space of insertion sort is O(1), what does O(1) mean ?
Which of the following is TRUE?
Consider a sorted array of n numbers. What would be the time complexity of the best known algorithm to find a pair a and b such that |a-b| = k , k being a positive integer.
What is the time complexity of the below function?
void fun(int n, int arr[])
{
int i = 0, j = 0;
for(; i < n; ++i)
while(j < n && arr[i] < arr[j])
j++;
}
Consider the following C program
int main()
{
int x, y, m, n;
scanf ("%d %d", &x, &y);
/* x > 0 and y > 0 */
m = x; n = y;
while (m != n)
{
if(m>n)
m = m - n;
else
n = n - m;
}
printf("%d", n);
}
What does the program compute?
Step(s) in Divide and conquer process that takes a recursive approach is said to be
The given array is arr = {2,6,1}. What are the pivots that are returned as a result of subsequent partitioning?
QuickSort can be categorized into which of the following?
An algorithm is a _________ set of precise instructions for performing computation.
The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is ______________.
What is the value of following recurrence?
T(n) = T(n/4) + T(n/2) + cn^2
T(1) = c
T(0) = 0
Where c is a positive constant
The complexity of Fibonacci series is
Which of the following is correct recurrence for worst case of Binary Search?
The time complexity of the following C function is (assume n > 0
int recursive (int n)
{
if (n == 1)
return (1);
else
return (recursive (n-1) + recursive (n-1));
}