adplus-dvertising
frame-decoration

Question

For a linear search in an array of n elements the time complexity for best, worst and average case are ......., ....... and ........ respectively

a.

O(1),O(n) and O(n)

b.

O(1), O(n) and O(n/2)

c.

O(n), O(1), and O(n/2)

d.

O(1), O(n) and (n-1/2)

Answer: (a).O(1),O(n) and O(n)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. For a linear search in an array of n elements the time complexity for best, worst and average case are ......., ....... and ........ respectively

Similar Questions

Discover Related MCQs

Q. The expression which accesses the (ij)th entry of am x n matrix stored in column majorform is

Q. An object that can be used in accessing another object, is known to be

Q. Basic mechanism for storing a large number of identically-typed objects are known to be

Q. Basic technique of using an array which is considered safer and easier is named as

Q. A collection of objects that are residing in one unit, is called

Q. Primitive method of using an array is said to be

Q. A collection of objects that need not be of same type, are stored in an

Q. Declaration and usage of arrays can be of basic numbered ways of

Q. Alter method of using an array is called

Q. Terminology that provides indirect access rather than direct access to an object, is said to be

Q. Which of these best describes an array?

Q. Assuming int is of 4 bytes, what is the size of int arr[15];?

Q. How do you initialize an array in C?

Q. How do you instantiate an array in Java?

Q. Which of the following is a correct way to declare a multidimensional array in Java?

Q. When does the ArrayIndexOutOfBoundsException occur?

Q. Which of the following concepts make extensive use of arrays?

Q. What are the advantages of arrays?

Q. What are the disadvantages of arrays?

Q. What is a bit array?