Linked List MCQ : Time Complexity (Multiple Choice Questions)


Consider the following Chart for Reference :
[table border="1"] Operation,Array,Singly Linked List
Read (any where), O(1) , O(n)
Add/Remove at end, O(1) , O(n)
Add/Remove in the interior , O(n), O(n)
Resize ,O(n) , N/A
Find By position, O(1) , O(n)
Find By target (value), O(n) , O(n)
[/table]

Congratulations - you have completed Data Structure.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%


Your answers are highlighted below.
Question 1
Consider the Singly linked list having n elements. What will be the time taken to add an node at the end of linked list if Pointer is initially pointing to first node of the list.
A
O(n)
B
O(1)
C
O(n2)
D
O(n-1)
Question 2
Pointer is pointing to the first element of the Node then time require to Insert Element to second position is __________.
A
O(n-1)
B
O(1)
C
O(n)
D
O(n2)
Question 3
Consider a linked list of n elements. What is the time taken to insert an element after element pointed by same pointer ?
A
O(n-1)
B
O(n)
C
O(1)
D
O(log n)
Question 4
The concatenation of two lists is to be performed in O(1) time. Which of the following implementations of a list could be used ?
A
Singly Linked List
B
Circular Doubly Linked List
C
Array Implementation of List
D
Doubly Linked List
Question 5
Time require to find any element of the linked list is _______.
A
None of these
B
O(1)
C
O(n)
D
O(n2)
Once you are finished, click the button below. Any items you have not completed will be marked incorrect. Get Results
There are 5 questions to complete.