Linked List Quiz
Linked List Quiz
Linked List Quiz
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is false about a doubly linked list?
a.
It requires more space than a singly linked list
b.
None of the mentioned
c.
The insertion and deletion of a node take a bit longer
d.
We can navigate in both the directions
Feedback
Your answer is correct.
The correct answer is: None of the mentioned
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
The advantage of arrays over linked lists is that they allow random accessing.
Question 2Answer
True
False
Feedback
The correct answer is 'True'.
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What kind of list is best to answer question like “What is the item at position k?”
a.
Circular linked list
b.
Doubly linked list
c.
Array implementation of list
d.
Singly linked list
Feedback
Your answer is correct.
The correct answer is: Array implementation of list
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Linked lists are not suitable to for the implementation of?
a.
Binary search
b.
Insertion sort
c.
Polynomial manipulation
d.
selection sort
Feedback
Your answer is correct.
The correct answer is: Binary search
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What would be the time complexity to find an element in the sorted linked list?
a.
O( n)
b.
O(n2)
c.
O(log n)
d.
O(1)
Feedback
Your answer is correct.
The correct answer is: O( n)
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the time complexity to count the number of elements in the linked list?
a.
None of the mentioned
b.
O( n)
c.
O(logn)
d.
O(1)
Feedback
Your answer is correct.
The correct answer is: O( n)
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
State True or False:
In circular linked-list, it is always required to define both head and tail nodes.
Question 7Select one:
False
True
Feedback
The correct answer is: False
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
You are given pointers to first and last nodes of a singly linked list, which of the following
operations are dependent on the length of the linked list?
a.
Insert a new element as a first element
b.
Delete the first element
c.
Add a new element at the end of the list
d.
Delete the last element of the list
Feedback
Your answer is correct.
The correct answer is: Delete the last element of the list
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What would be the time complexity to add a node at the end of singly linked list, if the is
only a pointer is pointing to the head of the list (there is no pointer to the last element)?
a.
O(1)
b.
O( n )
c.
O(n^2)
d.
O(log n)
Feedback
Your answer is correct.
The correct answers are: O( n ), O(n^2)
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
State True or False:
In a singly-linked list, there is no efficient way to insert a node before the last node of
the list, but we can insert a node after a given node or at the beginning of the list with
time complexity O(1).
Question 10Select one:
True
False
Feedback
The correct answer is: True
Question 11
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Suppose we are considering a singly linked list and p is some node in the list which has
successor node.
Select the most correct java code snippet
that inserts new node with value x after the node p.
Question 12
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What is the time complexity of inserting at the end in dynamic arrays?
a.
O(logn)
b.
O(1)
c.
Either O(1) or O( n)
d.
O( n)
Feedback
Your answer is correct.
The correct answer is: Either O(1) or O( n)
Question 13
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select the statement that is most correct.
Basically, the complexity (worst-case) of search algorithm in singly linked lists is
Question 13Select one:
O(1)
O(n^2)
O(n)
O(log n)
Feedback
The correct answer is: O ( n )
Question 14
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Suppose we are considering a doubly linked list and p is some node in the list which has
successor node.
Select the most correct java code snippet
that inserts new node with value x after the node p.
Question 14Select one:
Question 15
Correct
Mark 1.00 out of 1.00
Flag question
Question text
State True or False:
In a singly-linked list every element contains some data and a link to the next element, which
allows to keep the structure.
Question 15Select one:
True
False
Feedback
The correct answer is: True
Question 16
Correct
Mark 1.00 out of 1.00
Flag question
Question text
What would be the time complexity to insert an element at the second position in the linked
list?
a.
O(n2)
b.
O( n)
c.
O(1)
d.
None of the mentioned
Feedback
Your answer is correct.
The correct answer is: O(1)
Question 17
Correct
Mark 1.00 out of 1.00
Flag question
Question text
O(1)
O(n)
O(n^2)
O(log n)
Feedback
The correct answer is: O ( n )
Question 18
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Suppose we are considering a singly linked list and p is some node in the list which has
predecessor node.
Select the most correct java code snippet
that inserts new node with value x before the node p.
Node f = head;
while(f.next != p) f = f.next;
Node q = new Node(x);
q.next = null;
f.next = q;
Node f = head;
while(f.next != p) f = f.next;
Node q = new Node(x);
q.next = p;
f.next = q;
Node f = head;
while(f != p) f = f.next;
Node q = new Node(x);
q.next = p;
f.next = q;
Node f = head;
while(f.next != p) f = f.next;
Node q = new Node(x);
q.next = f;
f.next = q;
Feedback
The correct answer is: Node f = head;
while(f.next != p) f = f.next;
Node q = new Node(x);
q.next = p;
f.next = q;
Question 19
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following application makes use of a circular linked list?
a.
Allocating CPU to running applications
b.
Undo operation in a text editor
c.
All of the mentioned
d.
Recursive function calls
Feedback
Your answer is correct.
The correct answer is: Allocating CPU to running applications
Question 20
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Skip list helps avoiding sequential search.
Question 20Answer
True
False
Feedback
The correct answer is 'True'.
Question 21
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Linked lists allow easy insertion and deletion of information because such operations have a
local impact on the list.
Question 21Answer
True
False
Feedback
The correct answer is 'True'.