Given a sequence of integers, there are a few sequences
which result in balanced
binary search trees i.e., AVL trees. Write a program that
takes a sequence of integers
as input and outputs the number of such sequences that
result in the balanced binary
search trees.
Input Format:
Single line contains sequence of integers terminated by -1.
Output format:
Print the number of AVL tree possible from that input sequence.
Sample Input:
1 2 3 -1
Sample Output:
2
No Answer is Posted For this Question
Be the First to Post Answer
Everyday in his business a merchant had to weigh amounts from 1 kg to 121 kgs, to the nearest kg. What are the minimum number of different weights required and how heavy should they be?
X is a five letter word. if u remove the first letter, it is the name of the country.if u remove first two letters it is opposite to female.... find out 'x' friendzzzzzzzzzz....
11 Answers Aircel, Emirates, Roman, WhatsApp, Yahoo,
A tank can be filled by pipe A in 30 minutes and by pipe B in 24 minutes. Outlet pipe C can empty the full tank in one hour and twenty minutes. If the tank is empty initially and if all the three pipes A, B and C are opened simultaneously, in how much time will the tank be full?
What is the syllabus for numerical aptitude exam to be held by the United bank of India. Plz inform me through email. Thanking You!
We have 2 poles 5 m and 7 m height ropes are connected from top of one to tthe bottem of another find the intersection height of those poles.
4_4_4_4 = 20, what sign should be in _ (dash)fileds((+,-,/,*))
Three men - Sam, Cam and Laurie - are married to Carrie, Billy and Tina, but not necessarily in the same order. Sam's wife and Billy's Husband play Carrie and Tina's husband at bridge. No wife partners her husband and Cam does not play bridge. Who is married to Cam?
3 boys go to the restaurant. Their bill was 75 rs.. So they contributed 25 each. Manager then gives 5 rs back to the waiter and then waiter gave 3 rs back to them and put 2 rs into his pocket.. So their actual contribution is 24 because they got 1-1 rs back. so 24*3=72 and 2 rs into the waiter's pocket. so 74+2=74 where is 1 rs?
55 Answers College School Exams Tests, Garrison, Google, HCL, Jabong, Merlion, Rainbow Civil Engineers, Renault, TATA, Watair, Wipro,
Please send the SBI Clerical Post model question paper.
0 Answers State Bank Of India SBI,
A clock with the hours round the face in Roman block numbers, as illustrated in the sketch fell down and the dial broke into four parts....
One of the following is my secret word: AIM DUE MOD OAT TIE. With the list in front of you, if I were to tell you any one of secret word, then you would be able to tell the number of my secret word. Which is my secret word?
8 Answers AIM Research, Contata, Exxon Mobil, IBM, TCS, Vernalis Systems,
Two identical pack of cards A and B are shuffled thoroughly. One card is picked from A and shuffled with B. The top card from pack A is turned up. If this is the Queen of Hearts, what are the chances that the top card in B will be the King of Hearts?