Take FREE!! Online Cocubes Mock Test to Crack various Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Take 30+ FREE!! Online Arithmetic Aptitude Mock test to crack any Exams.

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 {
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 :: Commvault Societe Generale SAP Labs Capgemini

Post Your Answer Here:     

Rate This: +1 -2 +

Report Error

Please Login First Click Here