Stack

Stack concept is easy to understand
👁 271
statistics
calculate
Questions #: 4
Time:
Pass Score: 80.0%
Style
Mode

 

You can think of a stack as a list that has some operation restrictions where you can insert and delete at only one end of the list. LIFO is last in, first out, this is how the stack treats the elements it contains. The fundamental operations of the stack are push, pop and top. Push is the same as an insert but allows insertion only at the top of the stack. Top gets the last element inserted while pop removes the last element inserted.

Sometimes pop and top can be combined but they are still separate operations.
Usually you get stack underflow exception if you tried to pop from an empty stack and you get a stack overflow exception when you try to push into a full stack. In the below diagram, in order to get A, you need to pop C and then pop B and after that the last element in the stack is A.

stack.png

A stack is a list with some restricted operations

POINTS (1)

Correct Answer

Explanation

You can get an element which is positioned in the middle of a stack without touching the top elements

POINTS (1)

Correct Answer

Explanation

You can push an an element directly to the bottom of a stack

POINTS (1)

Correct Answer

Explanation

LIFO stands for

POINTS (1)

Correct Answer

Explanation

Views:
Trials:
Avg score:
0
sin cos tan
sin-1 cos-1 tan-1 π e
xy x3 x2 ex 10x
y√x 3√x √x ln log
( ) 1/x % n!
7 8 9 + MS
4 5 6 M+
1 2 3 × M-
0 . EXP ÷ MR
± RND C = MC

Document Actions