All Easy Articles

## Add two bit strings 2.7

Given two bit sequences as strings, write a function to return the addition of the two sequences. Bit strings can be of different lengths also.… Read More »

## Algorithms | Misc | Question 11 2

In a village, people build houses in the same side of the road. A thief plans to loot the village. He wants maximum amount of… Read More »

## Algorithms | Analysis of Algorithms | Question 8 2.2

What is the time complexity of the below function? filter_none edit close play_arrow link brightness_4 code void fun(int n, int arr[]) {     int i =… Read More »

## Algorithms | Sorting | Question 14 2.3

In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. Which of the following is… Read More »

## Data Structures | Array | Question 1 2

A program P reads in 500 integers in the range [0..100] exepresenting the scores of 500 students. It then prints the frequency of each score… Read More »

## C | Misc | Question 7 2

The number of tokens in the following C statement is (GATE 2000) filter_none edit close play_arrow link brightness_4 code printf(“i = %d, &i = %x”,… Read More »

## Algorithms | Analysis of Algorithms | Question 19 2

Consider the following program fragment for reversing the digits in a given integer to obtain a new integer. Let n = D1D2…Dm filter_none edit close… Read More »

## C | Storage Classes and Type Qualifiers | Question 11 2.3

Consider the following C function filter_none edit close play_arrow link brightness_4 code int f(int n)  {     static int i = 1;     if (n >= 5) … Read More »

## C | Dynamic Memory Allocation | Question 1 2.6

The most appropriate matching for the following pairs (GATE CS 2000) X: m=malloc(5); m= NULL;        1: using dangling pointers Y: free(n); n->value=5;         2: using uninitialized… Read More »

## C | Macro & Preprocessor | Question 9 2

Output? filter_none edit close play_arrow link brightness_4 code #include<stdio.h>  #define f(g,g2) g##g2  int main()  {     int var12 = 100;     printf(“%d”, f(var,12));     return 0;  } chevron_right… Read More »

## C | Operators | Question 11 2.3

filter_none edit close play_arrow link brightness_4 code #include <stdio.h>  int main()  {    int a = 10, b = 20, c = 30;    if (c >… Read More »

## C | Storage Classes and Type Qualifiers | Question 9 2.4

Output? filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int fun() {   static int num = 16;   return num–; }    int main() {… Read More »

## C | Storage Classes and Type Qualifiers | Question 8 2.7

filter_none edit close play_arrow link brightness_4 code #include<stdio.h> int main() {   typedef int *i;   int j = 10;   i *a = &j;   printf(“%d”, **a);   return… Read More »

## C | Storage Classes and Type Qualifiers | Question 3 2

filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int main() {     static int i=5;     if (–i){         printf(“%d “,i);         main();     } } chevron_right filter_none (A)… Read More »

## Algorithms | Graph Traversals | Question 2 2

Traversal of a graph is different from tree because (A) There can be a loop in graph so we must maintain a visited flag for… Read More »

## Algorithms | Dynamic Programming | Question 2 2

We use dynamic programming approach when (A) We need an optimal solution (B) The solution has optimal substructure (C) The given problem can be reduced… Read More »

## C | Macro & Preprocessor | Question 8 2

filter_none edit close play_arrow link brightness_4 code #include <stdio.h> #define a 10 int main() {   printf(“%d “,a);      #define a 50      printf(“%d “,a);   return… Read More »

## Algorithms | Analysis of Algorithms | Question 2 2

What is the time complexity of fun()? filter_none edit close play_arrow link brightness_4 code int fun(int n) {   int count = 0;   for (int i… Read More »

## C | Loops & Control Structure | Question 8 2

filter_none edit close play_arrow link brightness_4 code #include<stdio.h> int main() {    int n;    for (n = 9; n!=0; n–)      printf(“n = %d”, n–);    return 0;… Read More »

## C | Macro & Preprocessor | Question 6 2

filter_none edit close play_arrow link brightness_4 code #include <stdio.h> #define square(x) x*x int main() {   int x;   x = 36/square(6);   printf(“%d”, x);   return 0; }… Read More »