Consider the singly linked list. What is the worst-case time complexity of the best-known algorithm to delete the node a, pointer to this node is q, from the list?

This question was previously asked in
UGC NET Computer Science (Paper 2) Dec 2018 Paper
View all UGC NET Papers >
  1. O(1)
  2. O(lg n)
  3. O(n)
  4. O(n lg n)

Answer (Detailed Solution Below)

Option 3 : O(n)
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
8.7 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

Consider a singly linked list:

F1 R.S 3.4.20 Pallavi D1

In this case, node a is at the end of the list. Pointer q is given to this node. In this case, we need to traverse the complete list to delete that node and then rearrange the remaining nodes.

So, in worst case , when there are n elements in the list and element a is at the end. Then it takes O(n) time to delete that node in the worst case.

Latest UGC NET Updates

Last updated on Jun 6, 2025

-> The UGC NET Exam Schedule 2025 for June has been released on its official website.

-> The UGC NET Application Correction Window 2025 is available from 14th May to 15th May 2025.

-> The UGC NET 2025 online application form submission closed on 12th May 2025.

-> The June 2025 Exam will be conducted from 21st June to 30th June 2025

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More Singly Linked List Questions

More Linked List Questions

Get Free Access Now
Hot Links: teen patti real cash withdrawal teen patti master 2025 teen patti gold apk download teen patti casino download