Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Commvault Written Test Qs.(Data Structures) :: Linked Lists - 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

Asked In :: Commvault Societe Generale SAP Labs Capgemini

Post Your Answer Here:     

No Discussion on this question yet!