Data Structures :: Linked Lists

NA
SHSTTON
50
Solv. Corr.
67
Solv. In. Corr.
117
Attempted
2 M:54 S
Avg. Time

1 / 22

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
51
Solv. Corr.
56
Solv. In. Corr.
107
Attempted
0 M:0 S
Avg. Time

2 / 22

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
62
Solv. Corr.
42
Solv. In. Corr.
104
Attempted
0 M:17 S
Avg. Time

3 / 22

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
19
Solv. Corr.
53
Solv. In. Corr.
72
Attempted
0 M:0 S
Avg. Time

4 / 22

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 C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
49
Solv. Corr.
47
Solv. In. Corr.
96
Attempted
0 M:7 S
Avg. Time

5 / 22

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
32
Solv. Corr.
78
Solv. In. Corr.
110
Attempted
0 M:6 S
Avg. Time

6 / 22

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)

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
40
Solv. Corr.
47
Solv. In. Corr.
87
Attempted
0 M:0 S
Avg. Time

7 / 22

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
59
Solv. Corr.
28
Solv. In. Corr.
87
Attempted
0 M:3 S
Avg. Time

8 / 22

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)

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
23
Solv. Corr.
62
Solv. In. Corr.
85
Attempted
0 M:15 S
Avg. Time

9 / 22

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

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
35
Solv. Corr.
49
Solv. In. Corr.
84
Attempted
0 M:2 S
Avg. Time

10 / 22

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)

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace