# TOP 50+ Linear Search Iterative Quiz and Answers PDF

In this post Linear Search Iterative Quiz and Answers, we are going to discuss some most important multiple choice questions and answers on Linear Search Iterative. Linear search is a sorting algorithm. It works by comparing the search element with each of the elements in the list until it finds the right match or runs out of elements to check. In this article, we will show you the linear search algorithm, illustrate how it works and provide a few examples of its usage.

## Linear Search Iterative Quiz and Answers

a) O(n)
b) O(logn)
c) O(n2)
d) O(nx)

#### 2. Linear search(recursive) algorithm used in _____________

a) When the size of the dataset is low
b) When the size of the dataset is large
c) When the dataset is unordered
d) Never used

a) 4th call
b) 3rd call
c) 6th call
d) 5th call

#### 4. The array is as follows: 1,2,3,6,8,10. Given that the number 17 is to be searched. At which call it tells that there’s no such element? (By using linear search(recursive) algorithm)

a) 7th call
b) 9th call
c) 17th call
d) The function calls itself an infinite number of times

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

#### 6. Which of the following code snippet performs linear search recursively?

``````  a.      for(i=0;i<n;i++)
{
if(a[i]==key)
printf("element found");
}
``````
``````b.         LinearSearch(int[] a, n,key)
{
if(n<1)
return False
if(a[n]==key)
return True
else
LinearSearch(a,n-1,key)
}
``````
``````c.         LinearSearch(int[] a, n,key)
{
if(n<1)
return True
if(a[n]==key)
return False
else
LinearSearch(a,n-1,key)
}
``````
``````d.         LinearSearch(int[] a, n,key)
{
if(n<1)
return False
if(a[n]==key)
return True
else
LinearSearch(a,n+1,key)
}
``````

#### 7. Can linear search recursive algorithm and binary search recursive algorithm be performed on an unordered list?

a) Binary search can’t be used
b) Linear search can’t be used
c) Both cannot be used
d) Both can be used

a) T(n-2)+c
b) 2T(n-1)+c
c) T(n-1)+c
d) T(n+1)+c

#### 9. Is there any difference in the speed of execution between linear search(recursive) vs linear search(alternative)?

a) Both execute at the same speed
b) Linear search(recursive) is faster
c) Linear search(Iterative) is faster
d) Can’t be said

#### 10. Is the space consumed by the linear search(recursive) and linear search(iterative) the same?

a) No, recursive algorithm consumes more space
b) No, recursive algorithm consumes less space
c) Yes
d) Nothing can be said

## Linear Search Iterative Quiz and Answers

Test and refresh your knowledge of linear search, an algorithm used to locate a value in a data set. Practice questions assess your knowledge of the definition of linear search and its advantages and disadvantages.

• Definition of linear search