Commvault Written Test Qs.(Data Structures) :: Linked Lists - Discussion
Home > Freshers Archives > Commvault Placement Questions & Answers > MCQs Questions Discussion
36 / 40
Choose the correct option.
Assume single linked list pseudo code as follows?
struct Node {
data
next
}
record List {
Node firstNode
}
function1(List list) {
obsoleteNode = list.firstNode; list.firstNode = list.firstNode.next; free obsoleteNode;
}
function2(node node) {
obsoleteNode = node.next; node.next= node.next.next; free obsoleteNode;
}
function3(Node node,Node newNode) {
newNode.next = node.next;node.next= newNode
}
function4(List list, Node newNode) {
newNode.next = list.firstNode; list.firstNode = newNode;
}
Afunction1 removes the first node
Bfunction2 removes node past this one
Cfunction3 inserts newNode after node
Dfunction4 inserts newNode after current first node
Answer: Option (Login/Signup)
Show Explanation
What is the purpose of clear function provided.
def clear(self):
self.tail = None
self.head = None
Select one:
Asked In ::
SHORTCUT
What is the purpose of clear function provided.
def clear(self):
self.tail = None
self.head = None
Select one:
Read Full Answer
Report Error
Please Login First Click Here