# Tag Archives: Hike

Given a Perfect Binary Tree, reverse the alternate level nodes of the binary tree.  Given tree: a / \ b c / \ / \… Read More
Given a binary tree, a target node in the binary tree, and an integer value k, print all the nodes that are at distance… Read More
First Round Written Test 1. The test consisted of 10 MCQ’s on Aptitude and 10 MCQ’s on C programming. 2. It also consisted of 2… Read More
Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an opponent by… Read More
The cost of a stock on each day is given in an array, find the max profit that you can make by buying and… Read More
Given a binary tree, print boundary nodes of the binary tree Anti-Clockwise starting from the root. The boundary includes left boundary, leaves, and right boundary… Read More
Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is… Read More
Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no… Read More
We have discussed Overlapping Subproblems and Optimal Substructure properties in Set 1 and Set 2 respectively. We also discussed one example problem in Set… Read More
Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at… Read More
Given an array A[] consisting 0s, 1s and 2s. The task is to write a function that sorts the given array. The functions should put… Read More
Given a linked list, write a function to reverse every k nodes (where k is an input to the function).  Example:  Input: 1->2->3->4->5->6->7->8->NULL, K =… Read More
Given an expression string exp, write a program to examine whether the pairs and the orders of “{“, “}”, “(“, “)”, “[“, “]” are… Read More
Given an array arr[] of integers, find out the maximum difference between any two elements such that larger element appears after the smaller number. … Read More
Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7.    … Read More