Skip to content

Category Archives: Quizzes

The worst case running time to search for an element in a balanced in a binary search tree with n2^n elements is (A) (B) (C)… Read More
Let w(n) and A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size n. which… Read More
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by… Read More
Which of the following standard algorithms is not a Greedy algorithm? (A) Dijkstra’s shortest path algorithm (B) Prim’s algorithm (C) Kruskal algorithm (D) Huffman Coding… Read More
Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation… Read More
The recurrence relation capturing the optimal time of the Tower of Hanoi problem with n discs is. (GATE CS 2012) (A) T(n) = 2T(n –… Read More
Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph? (A) In adjacency list representation, space is… Read More
#include <stdio.h> int main() {   printf("%d", main);     return 0; } (A) Address of main function (B) Compiler Error (C) Runtime Error (D) Some random value… Read More
# include <stdio.h> int main() {    int i = 0;    for (i=0; i<20; i++)    {      switch(i)      {        case 0:          i += 5;        case 1:          i… Read More
#include <stdio.h> #define a 10 int main() {   printf("%d ",a);      #define a 50      printf("%d ",a);   return 0; } (A) Compiler Error (B) 10… Read More
What is the time complexity of fun()? int fun(int n) {   int count = 0;   for (int i = 0; i < n; i++)      for… Read More
Output? #include <stdio.h> int main() {     int c = 5, no = 10;     do {         no /= c;     } while(c--);         printf ("%d\n", no);     return… Read More
#include<stdio.h> int main() {    int n;    for (n = 9; n!=0; n--)      printf("n = %d", n--);    return 0; } What is the output? (A) 9… Read More
Output? # include <stdio.h> # define scanf  "%s Geeks Quiz " int main() {    printf(scanf, scanf);    return 0; } (A) Compiler Error (B) %s Geeks… Read More
#include <stdio.h> #define square(x) x*x int main() {   int x;   x = 36/square(6);   printf("%d", x);   return 0; } (A) 1 (B) 36 (C) 0 (D)… Read More

Start Your Coding Journey Now!