Skip to content

Category Archives: Quizzes

Given an unsorted array. The array has this property that every element in array is at most k distance from its position in sorted array… Read More
Given a sorted array of integers, what can be the minimum worst case time complexity to find ceiling of a number x in given array?… Read More
Which of the following sorting algorithms in its typical implementation gives best performance when applied on an array which is sorted or almost sorted (maximum… Read More
What is output? # include <stdio.h>    void print(int arr[]) {    int n = sizeof(arr)/sizeof(arr[0]);    int i;    for (i = 0; i < n; i++)… Read More
The following function reverse() is supposed to reverse a singly linked list. There is one line missing at the end of the function. /* Link… Read More
How many queues are needed to implement a stack. Consider the situation where no other data structure like arrays, linked list is available to you.… Read More
How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.… Read More
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity? (A) Insertion Sort (B) Quick Sort… Read More
What does the following function do for a given binary tree? int fun(struct node *root) {    if (root == NULL)       return 0;    if (root->left ==… Read More
What is the time complexity of Build Heap operation. Build Heap is used to build a max(or min) binary heap from a given array. Build… Read More
Which of the following is correct recurrence for worst case of Binary Search? (A) T(n) = 2T(n/2) + O(1) and T(1) = T(0) = O(1)… Read More
Which of the following is not a stable sorting algorithm in its typical implementation. (A) Insertion Sort (B) Merge Sort (C) Quick Sort (D) Bubble… Read More
Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using… Read More
What is recurrence for worst case of QuickSort and what is the time complexity in Worst case? (A) Recurrence is T(n) = T(n-2) + O(n)… Read More
Consider the following code. The function myStrcat concatenates two strings. It appends all characters of b to end of a. So the expected output is… Read More

Start Your Coding Journey Now!