Log in
Sign up for FREE
arrow_back
Library
Untitled Formative 4
By Guilherme Bezerra
star
star
star
star
star
Share
share
Last updated over 2 years ago
12 questions
Add this activity
1
1
1
1
1
1
1
1
1
1
1
1
Question 1
1.
What is the first element of a linked list called?
Node
Tail
Head
Link
Question 2
2.
Which data structure allows direct access to any element?
Linked list
Queue
Array
Stack
Question 3
3.
How can you access the next node in a linked list?
Using next pointer
Using previous pointer
By index
Directly
Question 4
4.
What operation is least efficient in linked lists?
Inserting at the end
Inserting at the start
Deleting the first element
Accessing elements in the middle
Question 5
5.
What does the 'head' of a linked list represent in C?
Final node of the list
Middle node of the list
A pointer to the list itself
The first node of the linked list
Question 6
6.
How can an element be inserted at the front of a linked list in C?
By replacing the head with a new node
By pointing a new node to the old head
Append it and reverse the list
By swapping the head with a new node
Question 7
7.
How does deletion work in a singly-linked list in C?
Rearrange pointers and releasing the memory of the removed node
Using a delete function on specific index
Setting the node to NULL
Directly overriding the value
Question 8
8.
Which operation on a singly linked list requires traversal of the entire list?
Accessing the last element
Checking if the list is empty
Removing the first element
Adding an element at the start
Question 9
9.
What is the first step in implementing a linked list in C?
Define the node structure
Start with function creation
Define the head pointer only
Initialize linked list size
Question 10
10.
For adding a new node at the end of a linked list in C, what should be done?
Make a tail node
Traverse the list till the last node is reached
Insert at the head
None of the above
Question 11
11.
Which function is typically used to allocate a new node in a linked list in C?
realloc()
calloc()
malloc()
free()
Question 12
12.
How can you free up the memory that is allocated to the linked list in C?
Use clear() method
free() the tail node
Using free() for each node
free() the head only