Can anyone make linear search program with only using loops. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can anyone make linear search program with only using loops.

31st Jan 2017, 5:55 PM
chitra gautam
chitra gautam - avatar
2 Answers
+ 7
you can also check like this let we searching for 5. while(search!=5) { if(search==5) {print successful; break; } }
1st Feb 2017, 7:51 AM
Ajay Agrawal
Ajay Agrawal - avatar
+ 2
position <- 0 found <- False while position < len(List) and not found: if List[position] = item: found <- True position <- position + 1
1st Feb 2017, 3:38 AM
Rodrigo Estevao
Rodrigo Estevao - avatar