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
there r 100 people who buys juice if v take 500 random sample we find 75 people who buys juice then how many random sample they need 2 find remaining 25 buyers
Three friends went to hotel for breakfast . After having breakfast total bill was Rs 25 . Each one contributed Rs 10. So total was Rs 30 . 30 is paid. waiter gave Rs 5 back to them . Three friend gave Rs 2 tips to waiter . From remaining Rs 3 each one took one rupee. As each one contributed ten . And each friend recieved one rupee back. Means each one had breakfast in nine rupee. So three friend had breakfast in 9+9+9=27. And Rs 2 is given to tips to waiter. So total money for breakfast for three friend was 27+2=29. Where is remaining one rupee?
There are 25 horses and five tracks. There is no stop clock and we have to find the top 5 horses in the bunch. What is the minimum possible races ?
consider 3 by 3 matrix & take 1-9 numbers but not repeat the numbers add each row and column then each row and column has the answer 13 how?
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,
A frog starts climbing 15 feet wall. Each hour he climbs 3 feet and rests for 30 minutes. During rest, he slips back 2 feet. How many hours does the frog take to reach the top?
At a recent painting competition,Jonny's rendition of a constable was not last.priya only just managed to avoid last place and came third.the lady who paintd a monkey was very successfull and took first place>Mary beat the lady who painted the lady the temple and the lady who painted the flower beat saching.can you determine who painted what and who won
Three men, including Gianni and three woman, including Sachi are in line at the BrentWood post office. Each has two different pieces of business to conduct. 1. The first person is a woman. 2. Carlos wants to send an overnight package. 3. Lau is just ahead of Pimentelli who is the same sex as Lau. 4. Gianni is two places ahead of the person who wants to buy stamps. 5. Knutson - who is the opposite sex than Rendler - isn't the person who wanted to complain about a mail carrier. 6. The six people, not necessarily in the same order are - Anthony, Donna, the person who wants to fill out a change-of-address form, the one who wants to buy a money order, the one who wants to send Airmail to Tibet and the second person in the line. 7. The four tasks of the last two people in line, not necessarily in the same order are - sending books fourth class, buying a money order, picking up a package and complaining about a mail carrier. 8. The person who wants to send books fourth class is just behind a person of the same sex. 9. Mary is just behind a person who wants to send an insured package. 10. The person who wants to send Airmail to Tibet is either two places ahead of or two places behind the one who wants to add postage to his or her meter. 11. Anthony isn't two places behind the who wants to pickup a registered letter. 12. Toriseza is two places ahead of the person who wants to pick up a package. 13. Knutson isn't just ahead of the person who wants to send an item parcel post. Can you figure out where each customer is in the line, his or her full name (one surname is Loti) and the two things he or she wants to accomplish? Provide your answer is POSITION - FIRST NAME - LAST NAME - BUSINESS format.
One side of the bottom layer of a triangular pyramid has 12 balls. How many are there in the whole pyramid? Note that the pyramid is equilateral and solid.
what job position/s are you currently holding with your current employer?
A man went into a fast food restaurant and ate a meal costing Rs. 105, giving the accountant a Rs. 500 note. He kept the change, came back a few minutes later and had some food packed for his girl friend. He gave the accountant a Rs. 100 note and received Rs. 20 in change. Later the bank told the accountant that both the Rs. 500 and the Rs. 100 notes were counterfeit. How much money did the restaurant lose? Ignore the profit of the food restaurant.
Silu and Meenu were walking on the road. Silu said, "I weigh 51 Kgs. How much do you weigh?" Meenu replied that she wouldn't reveal her weight directly as she is overweight. But she said, "I weigh 29 Kgs plus half of my weight." How much does Meenu weigh?