Which Of The Following Code Snippet Performs Linear Search #462
Which of the following code snippet performs linear search recursively?
This multiple choice question (MCQ) is related to the book/course gs gs122 Data Communication and Computer Network. It can also be found in gs gs122 Searching - Linear Search Recursive - Quiz No.1.
Which of the following code snippet performs linear search recursively?
for(i=0;i<n;i++) { if(a[i]==key) printf("element found"); }
LinearSearch(int[] a, n,key) { if(n<1) return False if(a[n]==key) return True else LinearSearch(a,n-1,key) }
LinearSearch(int[] a, n,key) { if(n<1) return True if(a[n]==key) return False else LinearSearch(a,n-1,key) }
LinearSearch(int[] a, n,key) { if(n<1) return False if(a[n]==key) return True else LinearSearch(a,n+1,key) }
Similar question(s) are as followings:
Online Quizzes of gs122 Data Communication and Computer Network
Sorting - Insertion Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - Insertion Sort - Quiz No.3
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - LSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.1
gs gs122 Data Communication and Computer Network
Online Quizzes
Sorting - MSD Radix Sort - Quiz No.2
gs gs122 Data Communication and Computer Network
Online Quizzes