MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Stack is also called as
A
Last in first out
B
First in last out
C
Last in last out
D
First in first out
Explanation: 

Detailed explanation-1: -A stack follows the LIFO (Last In First Out) principle, i.e., the element inserted at the last is the first element to come out. The insertion of an element into the stack is called push operation, and the deletion of an element from the stack is called pop operation.

Detailed explanation-2: -Stack is sometimes called a push down list. Stack is a special kind of list in which all insertions and deletions occur at one end, called the top. Push-down list is a list in which the next item to be removed is the item most recently stored (LIFO).

Detailed explanation-3: -Stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. Queue is a container of objects (a linear collection) that are inserted and removed according to the first-in first-out (FIFO) principle.

Detailed explanation-4: -Since the element at the top of the stack is the most recently inserted element using the insert operation, and it is also the one to be removed first by the delete operation, the stack is called a Last In First Out (LIFO) list.

Detailed explanation-5: -Piles is another name used for stack since data element are placed one above the other and the last element on the pile is the first one to be removed (LIFO)

There is 1 question to complete.