COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
____ operation adds an element to the top of the stack.
|
pop
|
|
push
|
|
peep
|
|
all of the above
|
Explanation:
Detailed explanation-1: -Push operation refers to inserting an element in the stack. Since there’s only one position at which the new element can be inserted-Top of the stack, the new element is inserted at the top of the stack. Pop operation refers to the removal of an element.
Detailed explanation-2: -The basic operations supported by a stack are push and pop. Push adds an element at the top of a stack. Pop removes the topmost element of a stack.
Detailed explanation-3: -Operations Performed on Stacks push : Adds an element to the top of the stack. pop : Removes the topmost element from the stack.
There is 1 question to complete.