Solveeit Logo

Question

Computer Science Question on Database Concepts

Consider the algorithm:
NameSearch (numList, key,n)
Step1: SET index = 0
Step2: WHILE index < n, REPEAT step3
Step3: IF numlist [index]-key THEN
PRINT "Element found at position", index + 1
STOP
ELSE
index = index+1
Step4: PRINT "Search unsuccessfull"
The algorithm performs

A

Random search

B

Search by hashing

C

Search by hashing

D

Binary search

Answer

Binary search

Explanation

Solution

The correct option is (D) :Binary search