Given a boolean expression with following symbols.  Symbols 'T' ---> true 'F' ---> false And following operators filled between symbols  Operators & ---> boolean AND… Read More
Find the distance between two keys in a binary tree, no parent pointers are given. The distance between two nodes is the minimum number of… Read More
The following is the definition of Binary Search Tree(BST) according to WikipediaBinary Search Tree is a node-based binary tree data structure which has the following… Read More
The problem is to count all the possible paths from top left to bottom right of a mXn matrix with the constraints that from each… Read More
Given an array of random numbers, Push all the zero’s of a given array to the end of the array. For example, if the given… Read More
Given a Binary Tree, extract all leaves of it in a Doubly Linked List (DLL). Note that the DLL need to be created in-place. Assume… 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
Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains… Read More
Given an unsorted array of positive integers, find the number of triangles that can be formed with three different array elements as three sides of… Read More
Given a sequence, find the length of the longest palindromic subsequence in it.  As another example, if the given sequence is “BBABCBCAB”, then the… Read More
Question: Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should return… Read More
Given an array A[], write a function that segregates even and odd numbers. The functions should put all even numbers first, and then odd numbers.… Read More
There are two sorted arrays. First one is of size m+n containing only m elements. Another one is of size n and contains n elements.… Read More