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
Tag Archives: Linkedin
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 binary 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… 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