
Data Structures Quiz

Quiz
•
Engineering
•
University
•
Medium
Kavitha N
Used 2+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the worst case time complexity of inserting a node in a doubly linked list?
O(nlogn)
O(logn)
O(n)
O(1)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following linked list: 2 -> 4 -> 7 -> 9 -> 10 -> 13. Their addresses are 2408, 2560, 1560, 5440, 3240, 3000. Head variable is pointing at 4 (the second node). What will be head -->next-->next-->value. (Node has value and next. value stores the value and next stores the address of the next variable).
7
9
10
13
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider a single linked list where F and L are pointers to the first and last elements respectively of the linked list. The time for performing which of the given operations depends on the length of the linked list? F->1->2->3->L
Delete the first element of the list
Interchange the first two elements of the list
Delete the last element of the list
Add an element at the end of the list
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operations is performed more efficiently by doubly linked list than by linear linked list?
Deleting a node whose location is given
Searching an unsorted list for a given item
Inserting a node after the node with a given location
Traversing the list to process each node
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary disadvantage of using a hash table (or HashSet) to detect a loop in a linked list?
It has a higher time complexity.
It requires additional space proportional to the number of nodes.
It cannot find the starting node of the loop.
It only works on sorted linked lists.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
log(2*n)
n/2
log(2*n) -1
n
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following function do for a given Linked List with first node as head?
void fun1(struct node* head) {
if(head == NULL)
return;
fun1(head->next);
printf("%d ", head->data); }
Prints all nodes of linked list
Prints all nodes of linked list in reverse order
Prints alternate nodes of Linked List
Prints alternate nodes in reverse order
Create a free account and access millions of resources
Similar Resources on Wayground
21 questions
Exploring Creative Coding Foundations

Quiz
•
University
16 questions
Quiz Pengelolaan Waktu Proyek

Quiz
•
University
25 questions
Data Structures and Algorithms Quiz-1

Quiz
•
University
15 questions
GENERAL PACKET RADIO SERVICES (GPRS)

Quiz
•
University
15 questions
Circuit Theory Self Learning Activity 1

Quiz
•
University
15 questions
24EE2081 - Quiz1

Quiz
•
University
21 questions
Fusion Vocabulary 2

Quiz
•
10th Grade - University
20 questions
Algorithm Time Complexity Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Engineering
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University