Skip to content
All Medium Articles
What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary search? (A) N… Read More
#include<stdio.h>  int main()  {    char *s[] = { "knowledge","is","power"};    char **p;    p = s;    printf("%s ", ++*p);    printf("%s ", *p++);    printf("%s ", ++*p);         return… Read More
#include<stdio.h> int main() {   typedef static int *i;   int j;   i a = &j;   printf("%d", *a);   return 0; } (A) Runtime Error (B) 0 (C)… Read More
#include <stdio.h> int main() {     int x = 5;     int const * ptr = &x;     ++(*ptr);     printf("%d", x);          return 0; } (A) Compiler Error… Read More
Output of following program? #include <stdio.h> int main() {     static int i=5;     if(--i){         main();         printf("%d ",i);     }     return 0; } (A) 4 3 2 1… Read More
The following C function takes a simply-linked list as input argument. It modifies the list by moving the last element to the front of the… Read More
Consider two binary operators ‘ ‘ and ‘‘ with the precedence of operator being lower than that of the operator. Operator is right associative while… 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
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
Output? # include <stdio.h> # define scanf  "%s Geeks Quiz " int main() {    printf(scanf, scanf);    return 0; } (A) Compiler Error (B) %s Geeks… Read More
What is time complexity of fun()? int fun(int n) {   int count = 0;   for (int i = n; i > 0; i /= 2)… Read More
#include <stdio.h> #define X 3 #if !X     printf("Geeks"); #else     printf("Quiz");     #endif int main() {         return 0; } (A) Geeks (B) Quiz (C) Compiler Error… Read More
In C, parameters are always (A) Passed by value (B) Passed by reference (C) Non-pointer variables are passed by value and pointers are passed by… Read More
We all aware of binary search algorithm. Binary search is easiest difficult algorithm to get it right. I present some interesting problems that I collected on binary… Read More
struct node  {     int i;     float j;  };  struct node *s[10]; The above C declaration define ‘s’ to be (GATE CS 2000) (A) An array,… Read More
Assume that size of an integer is 32 bit. What is the output of following program? #include<stdio.h> struct st {     int x;     static int y;… Read More
C++ supports function overloading, i.e., there can be more than one functions with same name and differences in parameters. How does C++ compiler distinguishes between… Read More
What is the output of following function for start pointing to first node of following linked list? 1->2->3->4->5->6 void fun(struct node* start) {   if(start ==… Read More
A computer system supports 32-bit virtual addresses as well as 32-bit physical addresses. Since the virtual address space is of the same size as the… Read More
Consider the following snapshot of a system running n processes. Process i is holding Xi instances of a resource R, 1 <= i <= n.… Read More