Stack

Stack concept is easy to understand

download Export
search_insights Statistics
stylus_note White Board
Quran
calculate Calculator
dictionary Dictionary
fullscreen Full Screen

QUESTION OF
Views #: 759
Questions #: 4
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.

A stack is a list with some restricted operations

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

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

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

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

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

LIFO stands for

1 pts
volume_mute
note_alt Add notes
flag Flag

Correct Answer

Explanation

Keywords
Year 10