manjunath426jc
BAN USER- 0of 0 votes
AnswersThe glasses are arranged in the following order
1 2 3 4 5 6 7 8 9 10 .................... ....................
When you pour liquid into the 1st glass if it's full, then the extra liquid would be flown into the glasses 2 and 3 in equal quantities. When glass 2 is full, the extra liquid would be flown into 4 and 5 and so on.
- manjunath426jc in India
Given an N liters of liquid and capacity of each glass is C and the number of levels of glasses is L. Give the amount of liquid present in each glass if you empty N liters of liquid by pouring into glass 1.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 1of 1 vote
AnswersYou are given two numbers in the form of linked list.Add them without reversing the linked lists. linked lists can be of any length.
- manjunath426jc in India
Ex:123 1->2->3
10234 1->0->2->3->4
ans: 10357 1->0->3->5->7| Report Duplicate | Flag | PURGE
Amazon Qualcomm Software Engineer / Developer Linked Lists - 0of 0 votes
AnswersYou have n strings with their lengths. You are given an add(string s1,string s2) which would concatenate the string s2 with s1 and return s3. Optimize the cost of concatenation of all these strings into one big string.
- manjunath426jc in India
Ex: 1,3,2 are the lengths of given strings.
1+3=4
4+2=6
total cost=10
Optimize this total cost?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer String Manipulation
I don't think that would help.
- manjunath426jc December 27, 2011For ex: 1,2,3,4,5 (cost is mentioned in brackets)
3,3,4,5 (3)
6,4,5 (6)
10,5 (10)
15 (15)
Total cost=34
Optimum cost=33