Font size
WorksheetsArray and Linked List ADT
Total questions: 30
Worksheet time: 16mins
numbers[i] = 2 * i + 1;
// Which index of the array holds the value of 5?
float average [20];
average[20] = 15.25;
float values[ ][ ] =
{ {1.2, 9.0, 3.2},
{9.2, 0.5, 1.5, -1.2},
{7.3, 7.9, 4.8} } ;
what is in values[2][1]?
float values[ ][ ] =
{ {1.2, 9.0, 3.2},
{9.2, 0.5, 1.5, -1.2},
{7.3, 7.9, 4.8} } ;
what is in values[3][0]?
int items[ ][ ] =
{ {0,1,3,4} , {4,3,99,0,7} , {3,2} } ;
Which of the following statements replaces the 99 with 77?
The doubly linked list would have how many fields in a node?
1
2
3
4
What is the best and worst-case time complexity for searching for a value in a Linked List?
O(1) and O(log n)
O(1) and O(1)
O(1) and O(n^2)
O(1) and O(n)
Below is a function, countNode, to calculate the number of nodes in a list. Fill in the blank with a proper statement.
int linkedList:: countNode (linkedList *list)
{
int count = 0;
ptr = list->head;
while (FILL IN THE BLANK)
{
count++;
ptr = ptr->next;
}
return count;
}
ptr != ptr->next
ptr = ptr ->next
ptr != NULL
ptr = NULL
In doubly linked lists, traversal can be performed?
a) Only in forward direction
b) Only in reverse direction
c) In both directions
d) In circular fashion
Which of the following is false about a doubly linked list?
a) We can navigate in both the directions
b) It requires more space than a singly linked list
c) The insertion and deletion of a node take a bit longer
d) Implementing a doubly linked list is easier than singly linked list
In which list user can navigate in both direction?
Singly Linked List
Doubly Linked List
Both
A node in a doubly linked list has at least _____ fields
4
2
3
5
The DATA field of the head node will usually contain information.
True
False
circular linked list
linked list
doubly circular linked list
doubly linked list
What type of linkedlist is represented in the image
singly linkedlist
doubly linkedlist
circular singly linkedlist
circular doubly linkedlist
How many nodes will ListSearch visit when searching for 54?
6
7
4
3
How many nodes will ListSearch visit when searching for 48?
0
6
3
1
What value does ListSearch return if the search key is not found?
5
1
null
6
Each node in a doubly-linked list contains data and _____ pointer(s).
1
2
None
3
Given a doubly-linked list with nodes 20, 67 and 11, node 20 is the _____.
Head
Tail
CurPointer
Next
Given a doubly-linked list with nodes 4, 7, 5, 1, node 7's previous pointer points to node _____.
4
5
1
null
Given a doubly-linked list with nodes 8, 12, 7, 3, node 7's next pointer points to node _____.
12
7
3
8
A variant of linked list in which last node of the list points to the first node of the list is?
Singly linked list
Doubly linked list
Circular linked list
Multiply linked list
In doubly linked lists, traversal can be performed?
Only in forward direction
Only in reverse direction
In both directions
None
What is value in the head -> next -> next -> data below?
34
12
88
3
What is value in the temp -> next -> next-> data below?
34
88
12
3
Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only.
Given the representation, which of the following operation can be implemented in O(1) time?
i) Insertion at the front of the linked list
ii) Insertion at the end of the linked list
iii) Deletion of the front node of the linked list
iv) Deletion of the last node of the linked list
I and II
I and III
I, II and III
I, II and IV
