Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Post New Answer

More Puzzles Interview Questions

100 Gold Coins Five pirates have obtained 100 gold coins and have to divide up the loot. The pirates are all extremely intelligent, treacherous and selfish (especially the captain). The captain always proposes a distribution of the loot. All pirates vote on the proposal, and if half the crew or more go "Aye", the loot is divided as proposed, as no pirate would be willing to take on the captain without superior force on their side. If the captain fails to obtain support of at least half his crew (which includes himself), he faces a mutiny, and all pirates will turn against him and make him walk the plank. The pirates start over again with the next senior pirate as captain. What is the maximum number of coins the captain can keep without risking his life?

5 Answers   Mu Sigma,


wo konsi chiz hai jo adi honay k bad b puri he rehti hai, or agr khatam b ho jae tab b puri he rehti hai. what is this?

1 Answers   Rizvi Associates,


You have 8 coins. 3 of them weigh x units, 3 y units, 1 a units and 1 b units. They are all mixed and look identical. You have to find the lightest coin in minimum number of weighing (balance)

1 Answers   Oracle,


Mr. Kamal Kishore rents a private car for Andheri-Colaba- Andheri trip. It costs him Rs. 300 everyday. One day the car driver informed Mr. Kamal Kishore that there were two students from Bandra who wished to go from Bandra to Colaba and back to Bandra. Bandra is halfway between Andheri and Colaba. Mr. Kamal Kishore asked the driver to let the students travel with him. On the first day when they came, Mr. Kamal Kishore said, "If you tell me the mathematically correct price you should pay individually for your portion of the trip, I will let you travel for free." How much should the individual student pay for their journey?

2 Answers   Freshdesk,


if 12+22=24 23+8=6 32+13=40 73+16=144 then 36+2=?

8 Answers   Wipro,


if 8men works 8hrs per day for 8days get rs.45,then how many men required if the work is 5hrs per day for 10days they get rs.60?(want solution with steps)

4 Answers   Syntel, Zensar,


A person wanted to withdraw X rupees and Y paise from the bank. But cashier made a mistake and gave him Y rupees and X paise. Neither the person nor the cashier noticed that. After spending 20 paise, the person counts the money. And to his surprise, he has double the amount he wanted to withdraw. Find X and Y.

6 Answers   Bajaj,


A lady has fine gloves and hats in her closet- 18 blue, 32 red, and 25 yellow. The lights are out and it is totally dark. In spite of the darkness, she can make out the difference between a hat and a glove. She takes out an item out of the closet only if she is sure that if it is a glove. How many gloves must she take out to make sure she has a pair of each color?

3 Answers  


An ant had to travel from one corner of a room to diagonally opposite corner. It can walk on walls, floor and roof only. How will you find the shortest path for this ant ?

9 Answers   Analog Devices, Cadence, TCS, ZS Associates,


There are 3 friends X,Y,Z having some chocolates each. X Gives Y and Z as many chocolates as they already have. After some days Y gives X and Z as many chocolates as they have. After some days Z gives X and Y as many chocolates as they have. Finally each has 24 chocolates. What is the original No. of chocolates each had in the beginning?

6 Answers   TCS,


There are 3 colored boxes - Red, Green and Blue. Each box contains 2 envelopes. Each envelope contains money - two of them contain Rs. 25000 each, two of them contain Rs. 15000 each and remaining two contain Rs. 10000 each. There is one statement written on the cover of each box. * Red Box: Both, a red box and a blue box contain Rs. 10000 each. * Green Box: Both, a green box and a red box contain Rs. 25000 each. * Blue Box: Both, a blue box and a green box contain Rs. 15000 each. Only one of the above 3 statements is true and the corresponding box contains the maximum amount. Can you tell which box contains the maximum amount and how much?

2 Answers  


what is Next number in the series is 1 , 2 , 4 , 13 , 31 , 112 , ?

10 Answers   Infosys,


Categories