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.
O(n) | |
O(1) | |
O(n2) | |
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 __________.
O(n-1) | |
O(1) | |
O(n) | |
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 ?
O(n-1) | |
O(n) | |
O(1) | |
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 ?
Singly Linked List | |
Circular Doubly Linked List | |
Array Implementation of List | |
Doubly Linked List |
Question 5 |
Time require to find any element of the linked list is _______.
None of these | |
O(1) | |
O(n) | |
O(n2) |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
There are 5 questions to complete.