Question
Consider the following stack operations. What will be
the content of the stack after executing all the operations? Stack stack = new Stack ();Â stack.push( 5 );Â stack.push( 10 );Â stack.pop();Â stack.push( 15 );Â stack.push( 20 );Â stack.pop();Â stack.push( 25 );ÂSolution
The stack operates on a Last-In, First-Out (LIFO) principle. The operations are executed as follows:
- stack.push(5) → Stack: [5]
- stack.push(10) → Stack: [5, 10]
- stack.pop() → Removes the top element 10 . Stack: [5]
- stack.push(15) → Stack: [5, 15]
- stack.push(20) → Stack: [5, 15, 20]
- stack.pop() → Removes the top element 20 . Stack: [5, 15]
- stack.push(25) → Stack: [5, 15, 25]
'P' invested Rs. 2,00,000 at compound interest of ___% p.a., compounded once every 4 months. If he kept the amount invested for 12 months, then interest...
What is the interest earned when Rs. 8000 is invested for 18 months in a scheme which offers compound interest (compounded every 6 months) of 20% p.a.
- A person invested Rs. 30,000 in two schemes. One scheme gives a simple interest of 7% p.a., while the other scheme gives 11% p.a. If the total interest ear...
In what time will Rs. 16000 amount to Rs. 19360 @ 10% compound interest?
A certain sum of money becomes Rs. 1250 in 1 year and 3556 in 3 years at certain rate of simple interest. Find the sum of money invested.
Jupiter borrowed a sum of Rs 31,500 from Mars at the rate of 14% per annum for 3 years. He added some more money in it and lent it to Saturn at the rate...
When Rs.6400 funded at SI of 12% p.a for certain years which gives an interest of Rs.3840. If Rs.5000 is invested at CI compounded annually of 1...
- An amount of Rs. 3,600 grows to Rs. 4,680 in 6 years under simple interest at the rate of r% per annum. If Rs. 4,500 is invested at a rate of 1.8r% per ann...
What will be the amount if a sum of Rs. 6500 is placed at compound interest for 3 years while the rate of interest for the first, second and third years...
The simple interest on Rs. (6p + 300) at 25% p.a. for 2 years is Rs. (2p + 350). Find the ratio (p - 100) :(p + 50)