All Easy Articles

## Intersection of n sets 2

Given n sets of integers of different sizes. Each set may contain duplicates also. How to find the intersection of all the sets. If an… Read More »

## Stack | Set 2 (Infix to Postfix) 2.8

Prerequisite – Stack | Set 1 (Introduction) Infix expression:The expression of the form a op b. When an operator is in-between every pair of operands.… Read More »

## Construct Complete Binary Tree from its Linked List Representation 2.8

Given Linked List Representation of Complete Binary Tree, construct the Binary tree. A complete binary tree can be represented in an array in the following… Read More »

## Counting Sort 2.3

Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values… Read More »

## Skip List | Set 1 (Introduction) 2.3

Can we search in a sorted linked list in better than O(n) time? The worst case search time for a sorted linked list is O(n)… Read More »

## Maximum Subarray Sum using Divide and Conquer algorithm 2.8

You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which has… Read More »

## C++ | Constructors | Question 3 2

Output of following program? filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std; class Point {     Point() { cout << “Constructor called”; }… Read More »

## Merge Sort 2.7

Like QuickSort, Merge Sort is a Divide and Conquer algorithm. It divides input array in two halves, calls itself for the two halves and then… Read More »

## Reverse Level Order Traversal 2.4

We have discussed level order traversal of a post in previous post. The idea is to print last level first, then second last level, and… Read More »

## Insertion Sort 2

Insertion sort is a simple sorting algorithm that works the way we sort playing cards in our hands. Algorithm // Sort an arr[] of size… Read More »

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

Output? filter_none edit close play_arrow link brightness_4 code #include <stdio.h>    int main(void) {     int i = 10;     const int *ptr = &i;     *ptr =… Read More »

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

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

## Algorithms | Recursion | Question 2 2

Consider the following recursive function fun(x, y). What is the value of fun(4, 3) filter_none edit close play_arrow link brightness_4 code int fun(int x, int… Read More »

## C | String | Question 11 2

Predict the output of the following program: filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int main() {     char str[] = “%d %c”, arr[]… Read More »

## C | Operators | Question 18 2

In C, two integers can be swapped using minimum (A) 0 extra variable (B) 1 extra variable (C) 2 extra variable Answer: (A) Explanation: We… Read More »

## C | Input and Output | Question 13 2

Which of the following is true (A) gets() can read a string with newline chacters but a normal scanf() with %s can not. (B) gets()… Read More »

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

Predict the output of the following program: filter_none edit close play_arrow link brightness_4 code #include <stdio.h> int main() {     int check = 20, arr[] =… Read More »

## Pancake sorting 2.6

Given an unsorted array, sort the given array. You are allowed to do only following operation on array. flip(arr, i): Reverse array from 0 to… Read More »

## Data Structures and Algorithms | Set 31 2

Following questions have been asked in GATE CS 2013 exam. 1) What is the return value of f(p, p) if the value of p is… Read More »

## C++ | References | Question 1 2.5

What is the return value of f(p, p) if the value of p is initialized to 5 before the call? Note that the first parameter… Read More »