r/computerscience • u/Obi_Wan_06 • Sep 24 '25
does sequential search compare every element even if there is an absence?
like for example we have this list (1,5,17,40,92,100) and i want to see how many comparisons will it do to understand that the number 35 for example is missing. will it stop at 40 or will it go till the end of the list?
1
Upvotes
View all comments
Show parent comment
-2
u/Ronin-s_Spirit Sep 24 '25
Binary search? I don't really get it, you still have to work to sort it in the first place, seems more like a miscalculation of effort rather than efficiency gain.