Given a tree of order n which is neither complete or a search tree, write a function to construct a new tree of order m in-place. Memory usage is bound to 2 times the size of the tree. The new tree must be complete, and a node A cannot be a child of another node B in the new tree if A was an ancestor of B in the old tree.
Development Interview Questions
137,356 development interview questions shared by candidates
Write test cases for the above function.
find if string1 exists in string2, give test conditions
Write code in your favorite programming language that will accept two strings and return true if they are anagrams.
How many people can you stuff in a school bus
Given inorder and preorder traversals of a tree, reconstruct the tree.
Given a string "aaabbc", convert it to "3a2b1c". Output the result only its length is smaller than the input length.
Given an array of positive and negative numbers, give an algorithm that would find the sequence of numbers that give the largest sum. The numbers have to be in sequential order.
Write code to search a substring from another string
Find cycle in linked list.
Viewing 1761 - 1770 interview questions