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]
Which of the following is NOT one of the four priorities on which the budget proposal of 2022-23 rests ?
Dexie Ltd has a preferred stock that pays a dividend of 8 per share and the current price of stock is 100. What is the cost of preferred stock?
The instrument where coupon and principal payments of bonds are converted into separate securities and are separately traded is called:
Recently Ministry of Home has approved an amount of Rs. 17.20 crore as the Central share of the State Disaster Response Fund (SDRF) to which of the foll...
What was the headline wholesale price index (WPI)-based inflation for March?
Tamilnad Mercantile Bank celebrated its ________ foundation day on 11th November, 2021.
In December 2021, SEBI constituted an Advisory committee for Leveraging Regulatory and Technology Solutions (ALeRTS). This committee is headed by ______?
Which of the following methods should be used by an enterprise holding investment properties to value Investment property , a s per AS 10 (Revised) ‘P...
What was the value of India's outward FDI commitments in March 2024 according to RBI data?
Which of the following is NOT a feature of the forex market?