All Easy Articles

## Operating Systems | Set 12 2

Following questions have been asked in GATE CS 2007 exam. 1) Consider a disk pack with 16 surfaces, 128 tracks per surface and 256 sectors… Read More »

## Floyd Warshall Algorithm | DP-16 2.7

The Floyd Warshall Algorithm is for solving the All Pairs Shortest Path problem. The problem is to find shortest distances between every pair of vertices… Read More »

## Find a triplet that sum to a given value 2.6

Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is… Read More »

## Maximum Sum Increasing Subsequence | DP-14 2.7

Given an array of n positive integers. Write a program to find the sum of maximum sum subsequence of the given array such that the… Read More »

## Find subarray with given sum | Set 1 (Nonnegative Numbers) 2.7

Given an unsorted array of nonnegative integers, find a continuous subarray which adds to a given number. Examples : Input: arr[] = {1, 4, 20,… Read More »

## Initialization of variables sized arrays in C 2

The C99 standard allows variable sized arrays (see this). But, unlike the normal arrays, variable sized arrays cannot be initialized. For example, the following program… Read More »

## Find if there is a path between two vertices in a directed graph 2.2

Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second. For example, in… Read More »

## Find the maximum sum leaf to root path in a Binary Tree 2.9

Given a Binary Tree, find the maximum sum path from a leaf to root. For example, in the following tree, there are three leaf to… Read More »

## Detect Cycle in a Directed Graph 2.9

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least… Read More »

## Union and Intersection of two Linked Lists 2.5

Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. Order of elments… Read More »

## Activity Selection Problem | Greedy Algo-1 2.3

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate… Read More »

## Breadth First Search or BFS for a Graph 2.4

Breadth First Traversal (or Search) for a graph is similar to Breadth First Traversal of a tree (See method 2 of this post). The only… Read More »

## Depth First Search or DFS for a Graph 2.3

Depth First Traversal (or Search) for a graph is similar to Depth First Traversal of a tree. The only catch here is, unlike trees, graphs… Read More »

## C Language | Set 9 2.4

Following questions have been asked in GATE 2012 exam. 1. What will be the output of the following C program segment? filter_none edit close play_arrow… Read More »

## Convert a given tree to its Sum Tree 2.6

Given a Binary Tree where each node has positive and negative values. Convert this to a tree where each node contains the sum of the… Read More »

## Binomial Coefficient | DP-9 2.5

Following are common definition of Binomial Coefficients. A binomial coefficient C(n, k) can be defined as the coefficient of X^k in the expansion of (1… Read More »

## Minimum number of jumps to reach end 2.8

Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a function… Read More »

## Sorted Array to Balanced BST 2.4

Given a sorted array. Write a function that creates a Balanced Binary Search Tree using array elements. Examples: Input: Array {1, 2, 3} Output: A… Read More »

## Find the maximum element in an array which is first increasing and then decreasing 2.3

Given an array of integers which is initially increasing and then decreasing, find the maximum value in the array. Examples : Input: arr[] = {8,… Read More »

## A comma operator question 2.5

Consider the following C programs. filter_none edit close play_arrow link brightness_4 code // PROGRAM 1 #include<stdio.h>    int main(void) {     int a = 1, 2,… Read More »