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
It comes once in a year and twice in a week what is that?
20 Answers AJ Square Inc, HCL, Infosys,
I can take a bca student instead of you then why should i hire you
Write Eleven Lakh,Eleven Thousand,Eleven Hundred,Eleven in figures.
15 Answers Alard College, LIC, Nishant Mouldings, WinSoft,
1.At the recent web developres bowling match,two ganes were played.Kiev beat stuart in both games;also Richard beat John in both games.The winner in game1 second in game2.Richard won game2 and John beat stuart in game1.No player got the same placing twice.Can you determine who finished where in each game?
Your job is to create a simple sum that adds up to 12. You have to use the same number three times and you cannot use the number 4
in a village 4000 people watch a tv.in which 1500 watch A channel.2000 watch B channel and 2500 watch C Channel.500 people watch A and B channel.800 watch A and C Channel.1000 watch B and C Cahnnel.find maximum people who watch maximum no of channels?
i want model paper on SBI Clerk post,plz sed previous papers
56 Answers Abhyudaya Co-operative Bank, BMC, Clerical Jobs, JAS, Rohit Technologies, State Bank Of India SBI,
If 5/2 artists make 5/2 paintings using 5/2 canvases in 5/2 days then how many artists r required to make 25 paintings using 25 canvases in 25 days?
Find out the smallest four digit number which is divisible from 1 to 10?
33 Answers IBM, Infosys, TCS,
In a sports contest there were m medals awarded on n successive days (n > 1). 1. On the first day 1 medal and 1/7 of the remaining m - 1 medals were awarded. 2. On the second day 2 medals and 1/7 of the now remaining medals was awarded; and so on. 3. On the nth and last day, the remaining n medals were awarded. How many days did the contest last, and how many medals were awarded altogether?
rich man keeps me in pocket, poor men throws me away, children eat me, am a tamil word _u_ _e_ _l
9 Answers Adama Agricultural Solutions, Infosys, Mannar Company, Wipro,
4_4_4_4=22 use all sign of maths