MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is true about linked list implementation of stack?
A
In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.
B
In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.
C
Both of the above
D
None of the above
Explanation: 

Detailed explanation-1: -The following is true about linked list implementation of stack. If new nodes are added to the linked list’s beginning during a push operation, nodes must be removed from the end during a pop operation.

Detailed explanation-2: -Which of the following is true about linked list implementation of stack? (A) In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.

Detailed explanation-3: -37) Which of the following option is true if implementation of Queue is from the linked list? Explanation: The answer is O(n) because we need to traverse till the n element to delete the element from the rear end.

Detailed explanation-4: -Explanation: A linked list is a collection of objects linked together by references from an object to another object. By convention these objects are names as nodes. Linked list consists of nodes where each node contains one or more data fields and a reference(link) to the next node.

There is 1 question to complete.