Data Structures and Algorithms Design Week 4 Answers

Are you looking for Data Structures and Algorithms Design Week 4 Answers ? All weeks solutions of this Swayam course are available here.


Data Structures and Algorithms Design Week 4 Answers
Data Structures and Algorithms Design Week 4 Answers

Data Structures and Algorithms Design Week 4 Answers (July-Dec 2025)

Course link: Click here to visit course on Nptel Website


Question 1. What is the time complexity of inserting an element at the beginning of a singly linked list?

a) O(n)
b) O(nlogn)
c) O(1)
d) O(logn)

View Answers


Question 2. Consider the linked list : 1→2→3→4→5→6. What will the linked list look like after implementing the code below?
temp1 = head->next
temp2 = temp1->next
temp1->next = temp2->next

a) 1→2→3→4→5→6
b) 2→3→4→5→6
c) 1→3→4→5→6
d) 1→2→4→5→6

View Answers


Question 3. A singly linked list initially contains nodes with values: 12 → 47 → 85 → 63 → 29. The following operations are performed in code:

Node* p = head->next;
Node* temp = new Node(99);
temp->next = p->next;
p->next = temp;
p->next = p->next->next;

What is the final list?

a) 12 → 47 → 99 → 85 → 63 → 29
b) 12 → 47 → 99 → 63 → 29
c) 12 → 47 → 85 → 63 → 29
d) 12 → 99 → 47 → 85 → 63 → 29

View Answers


Question 4. For the Range Minima problem, what is the time complexity per query using a brute-force approach when space complexity is O(n)?

a) O(n)
b) O(logn)
c) O(1)
d) O(n²)

View Answers


Question 5. A doubly linked list initially contains nodes: 10↔25↔40↔60. You execute the following operations:

Node* p = head->next;
Node* temp = new Node(44);
temp->next = p->next;
temp->prev = p;
p->next->prev = temp;
p->next = temp;

What is the final list?

a) 10↔44↔25↔40↔60
b) 44↔10↔25↔40↔60
c) 10↔40↔60
d) 10↔25↔44↔40↔60

View Answers


Question 6. A circular singly linked list contains the nodes: 5→12→19→27→34→5 (circular). A pointer tail points to the node with value 34. You execute the following line of code:

tail->next = tail->next->next->next;

What does the updated circular list contain, starting from tail->next?

a) 12→19→27→34→12
b) 19→27→34→19
c) 5→12→27→34→5
d) 19→27→34→5→19

View Answers

These are Data Structures and Algorithms Design Week 4 Answers


Question 7. Suppose we solve the 1D Range Minima Problem using an efficient algorithm that preprocesses the array in O(nlogn) time. What is the time complexity of answering a single query after this preprocessing?

a) O(1)
b) O(logn)
c) O(n)
d) O(nlogn)

View Answers


Question 8. Consider the following binary tree: What is the path followed and output when performing binary search for the key 65?

a) 50 → 30 → 40 → 65, output = 65
b) 50 → 70 → 90 → 65, output = 65
c) 50 → 70 → 60 → 65, output = 65
d) 50 → 70 → 60, Key not found

View Answers


Question 9. Which of the following best describes a struct data structure?

a) A dynamic container for only one type of data
b) A collection of variables of different types grouped together under one name
c) A data structure used only for memory allocation
d) A specialized tree-like data structure for searching records

View Answers


Question 10. A binary search tree contains the keys 5, 10, 15,…, 100, inserted in increasing order. The resulting BST has height 19. How many nodes are visited when searching for the key 100?

a) 10
b) 1
c) 20
d) 5

View Answers


These are Data Structures and Algorithms Design Week 4 Answers

Click here for all nptel assignment answers