[algogeeks] Re: another q on ds!

2011-08-21 Thread Dumanshu
first option is correct. Because we are not allowed to use any extra space. On Aug 21, 6:36 pm, priya ramesh love.for.programm...@gmail.com wrote: A Most efficient data structure is designed to optimize the following operations. Pop, Push, Min. The best possible time-complexities with no extra

Re: [algogeeks] Re: another q on ds!

2011-08-21 Thread Jagannath Prasad Das
Since long time i am not able to implement a min-stack where in const space and const time ... Folks please help meif it is solved then answer is the last option On Sun, Aug 21, 2011 at 9:15 PM, Dumanshu duman...@gmail.com wrote: first option is correct. Because we are not

Re: [algogeeks] Re: another q on ds!

2011-08-21 Thread dilip makwana
If we can have additional O(n) space than all operations wil take O(1) ..additional MinStack implementation.. But if we are not allowed O(n) space then at the cost of GetMinimum to become O(1) we have to sacrifice for push and pop to be O(n)..{this is not mentioned in option} So most efficient

Re: [algogeeks] Re: another q on ds!

2011-08-21 Thread Amol Sharma
i'll go with the first option...since no extra space is allowed this ques was asked by amazon in written in our college.don't know the correct answer...it all depends on what Most efficient data structure isi.e what option they do frequently min or push or pop

Re: [algogeeks] Re: another q on ds!

2011-08-21 Thread saurabh singh
It all depends on the definition of no *extra space.*For me the question was ambigous On Mon, Aug 22, 2011 at 12:27 AM, Amol Sharma amolsharm...@gmail.comwrote: i'll go with the first option...since no extra space is allowed this ques was asked by amazon in written in our