Great explanation. But answer will be 24 as 5 more processes makes it 6 overall. 6*4=24.
Actually it is correct if nearest means by position rather than value. So I guess you are right. I thought nearest means by value.
Does not work for 1 5 4 3 5 1 2.
We cannot pop and discard all smaller values like that.
What if a larger values empties the stack. This way it throws away values that may be needed later as in my example.
jonesreina93, Hawaiian airlines reservations at American Airlines
Hello, I am currently working at the airport as an air hostess, and my responsibility are Check tickets and assisted ...
lyndaander9, Analyst at A9
My name is Anderson and I am a 24 years old trader born and currently working in New York, USA ...
brakpeter2, AT&T Customer service email at Absolute Softech Ltd
My Profession Is photography for a number of years.My Friends were interested in photography, so I was always exposed ...
- krshnsh November 01, 2013