Inorder Tree Traversal without Recursion
Using Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step… Read More »
Using Stack is the obvious way to traverse tree without recursion. Below is an algorithm for traversing binary tree using stack. See this for step… Read More »
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More »
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More »
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More »
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More »
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More »
There is a list of items. Given a specific word, e.g., “sun”, print out all the items in list which contain all the characters of… Read More »
Following questions have been asked in GATE CS 2005 exam. 1) A program P reads in 500 integers in the range [0..100] representing the scores… Read More »
Following questions have been asked in GATE CS 2008 exam. 1. The subset-sum problem is defined as follows. Given a set of n positive integers,… Read More »
Original Linked List Result Linked List 1 Result Linked List 2 If there are odd number of nodes, then first list should contain one extra.… Read More »
Following questions have asked in GATE CS 2006 exam. 1. Let S be an NP-complete problem and Q and R be two other problems not… Read More »
Given an integer n, find whether it is a power of 4 or not. Example : Input : 16 Output : 16 is a power… Read More »
Write a C function to reverse a given Doubly Linked List See below diagrams for example. (a) Original Doubly Linked List (b) Reversed Doubly Linked… Read More »
Following questions have been asked in GATE CS 2009 exam. 1. Let X be a problem that belongs to the class NP. Then which one… Read More »
A tree where no leaf is much farther away from the root than any other leaf. Different balancing schemes allow different definitions of “much farther”… Read More »