Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Data Structures :: Linked Lists

Home > Data Structures > Linked Lists > General Questions

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

Answer: addNode

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

Tags:

No Tags on this question yet!

2. 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

Answer: X->next->prev = x->prev x->prev->next = x->next x->next = head head->prev=x

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

3. 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

Answer: pointer-variable= malloc(sizeof(*struct-narne));

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

4. 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;
}

Answer: function3 inserts newNode after node

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

5. Which of the following can a Dynamic Link Library contain?

Answer: Code, Data and Resources

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: O(1)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

7. In a circular linked list

Answer: there is no beginning and no end.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: O(1)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: Deleting a node whose location in given

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: O(1)

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!