Data Structures :: Linked Lists

NA
SHSTTON
131
Solv. Corr.
191
Solv. In. Corr.
322
Attempted
2 M:11 S
Avg. Time

1 / 48

Choose the correct option.

What Member function places a new node at the end of the linked list?


AaddNode

Bappend Node

CDisplayNode

DStructNode

ENone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

The appendNode() member function places a new node at the end of the linked list. The appendNode() requires an integer representing the current data of the node.

Workspace

NA
SHSTTON
149
Solv. Corr.
164
Solv. In. Corr.
313
Attempted
0 M:0 S
Avg. Time

2 / 48

Choose the correct option.

How would you make the middle node of a doubly linked list to the top of the list?
Let assume "X" is the middle node


AX->next->prev = x->prev x->prev->next = x->next x->next = head head->prev=x

Bx->next = head head->prev=x

CX->next->prev=x->next x->prev->next = x->prev x->next = head head->prev=x

DNone of these

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
150
Solv. Corr.
137
Solv. In. Corr.
287
Attempted
0 M:37 S
Avg. Time

3 / 48

Choose the correct option.

To create a linked list, we can allocate space and make something point to it, by

writing:

struct-narne *pointer-variable;

Which of the following statement will correctly allocate the space


Apointer-variable= malloc(sizeof(*struct-narne));

Bpointer-variable = malloc(sizeof(struct struct-name));

Cpointer-variable = a!loc(sizeof(struct struct-name));

Dpointer-variable = alloc(sizeof(*struct-name));

 View Answer |  Discuss in Forum |  Workspace | Asked In BOA (Bank of America) |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
44
Solv. Corr.
155
Solv. In. Corr.
199
Attempted
0 M:0 S
Avg. Time

4 / 48

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

 View Answer |  Discuss in Forum |  Workspace | Asked In CommvaultSociete Generale |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
117
Solv. Corr.
145
Solv. In. Corr.
262
Attempted
0 M:7 S
Avg. Time

5 / 48

Choose the correct option.

Which of the following can a Dynamic Link Library contain?


AOnly Code

BCode and Data Only

CCode and Resources only

DCode, Data and Resources

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
93
Solv. Corr.
193
Solv. In. Corr.
286
Attempted
0 M:9 S
Avg. Time

6 / 48

Choose the correct option.

Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer?


AO(1)

BO(log2 n)

CO(n)

DO(nlog2 n)

 View Answer |  Discuss in Forum |  Workspace | Asked In Sopra SteriaSociete Generale |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
128
Solv. Corr.
137
Solv. In. Corr.
265
Attempted
0 M:21 S
Avg. Time

7 / 48

Choose the correct option.

In a circular linked list


Acomponents are all linked together in some sequential manner.

Bthere is no beginning and no end.

Ccomponents are arranged hierarchically.

Dforward and backward traversal within the list is permitted.

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
184
Solv. Corr.
72
Solv. In. Corr.
256
Attempted
0 M:3 S
Avg. Time

8 / 48

Choose the correct option.

In a linked list with n nodes, the time taken to insert an element after an element pointed by some pointer is


AO(1)

BO(log n)

CO(n)

DO(n1og n)

 View Answer |  Discuss in Forum |  Workspace | Asked In Sopra SteriaSociete Generale |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
83
Solv. Corr.
173
Solv. In. Corr.
256
Attempted
0 M:37 S
Avg. Time

9 / 48

Choose the correct option.

Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?


ADeleting a node whose location in given

BSearching of an unsorted list for a given item

CInverting a node after the node with given location

DTraversing a list to process each node

 View Answer |  Discuss in Forum |  Workspace | Asked In Sopra Steria |

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
94
Solv. Corr.
155
Solv. In. Corr.
249
Attempted
0 M:2 S
Avg. Time

10 / 48

Choose the correct option.

The time required to delete a node x from a doubly linked list having n nodes is


AO(n)

BO(log n)

CO(1)

DO(n log n)

 View Answer |  Discuss in Forum |  Workspace | Asked In Sopra Steria |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace