Following questions have been asked in GATE CS 2007 exam. 1) A virtual memory system uses First In First Out (FIFO) page replacement policy and… Read More

All Easy Articles

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

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

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

Given a Directed Graph and two vertices in it, check whether there is a path from the first given vertex to second. Example: Consider the following… Read More

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

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

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

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

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

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

Following questions have been asked in GATE 2012 exam. 1. What will be the output of the following C program segment? char inchar = 'A';… Read More

Predict the output of following C programs. Question 1 #include <stdio.h> int main() { int arr[] = {}; printf("%d", sizeof(arr)); return 0; } Output:… Read More