aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Data Base Management System
  • What is the time required to search an element in a linke...
Multiple choice

What is the time required to search an element in a linked list of length 'n'?

  1. O(log2 n)

  2. O(n)

  3. O(1)

  4. O(n2)

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In an unsorted linked list, you must traverse the list node by node to find a specific element. This linear search takes O(n) time in the worst case.

Keep practicing — related questions

  • Consider a linked list of 'n' elements. What is the time taken to insert an element after pointed by some p...
  • In the worst case, the number of comparisons needed to search a single linked list of length n for a given ...
  • Time complexity of finding middle node of a single linked list is:
  • Consider a linked list of 'n' elements which is pointed by an external pointer. What is the time taken to d...
  • If I have a linked list and a array, find the ratio of time complexity to find the index value in the array...
  • Given a linked list, in what complexity can you reverse it.
  • Which of the following statements is/are true? 1. The time complexity for searching an element in binary se...
  • If there are n devices (nodes) in a network,what is the number of cable links required for a mesh and a sta...
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Data Structures and Algorithms (1518 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy