

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
solution to various assignment questions
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!
look for the required entry such that in Linear Searching. In it running time increases linearly with the size of the input data For value in data: Print(value) For Example : Imagine a class of 50 students in which you gave your notebook to one person. Now you want that notebook back, therefor you go to each student and ask them individually. Pseudo Code: LinearSearch(list,ReqEntry) { Int i = 0 While (i<number of items in the list) { If (list[i] == ReqEntry) { Return i } i++ } Return - }
entry, see if this is the required entry. In it the first entry has the information of other entries, so we ask it about the remaining entries such that in Quadratic Time Complexity Searching. For x in data: For y in data: Print(x,y) For Example : Imagine a class of 50 students in which you gave your notebook to one person. Now you want that notebook back, therefor you go and ask the first person whether he has the notebook. Also you ask this person about other 49 people in the classroom if they have the notebook and so on. Pseudo Code: QuadTimeComplexitySearch(list,ReqEntry) { Int i Int j If (list[i] == ReqEntry) { Return i } Else { For (i=0; i<number of items in the list; i++) { For(j=0; j<i; j++) { If (list[j] == ReqEntry)