RE: Application of Binary search in SQLI 06-18-2013, 08:47 PM
#11
I understood it that way and when I mentioned that some code would be nice, I didn't mean a function searching for a value in an array. That's something everyone can find with google.
I apprechiate the practical way of explaining this algorithm. But doing this manually is only the first step in understanding, if you really work on a problem like this you can go a step further and create your own script that does the binary search for you (everything else is cumbersome, a good hacker should have some lazyness when it comes to repeated tasks). So I think such a script would be a great addition to your tutorial.
Edit:
50 / 2 = 25, not 20.
If you choose an arbitrary number you are not doing a binary search. Binary search always takes the element in the middle.
I apprechiate the practical way of explaining this algorithm. But doing this manually is only the first step in understanding, if you really work on a problem like this you can go a step further and create your own script that does the binary search for you (everything else is cumbersome, a good hacker should have some lazyness when it comes to repeated tasks). So I think such a script would be a great addition to your tutorial.
Edit:
Quote:Then we try with 20. Again we get the same error. So it's between 1 and 20 as well.
50 / 2 = 25, not 20.
If you choose an arbitrary number you are not doing a binary search. Binary search always takes the element in the middle.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.
Expressed feelings are just an attempt to simulate humans.
![[Image: 2YpkRjy.png]](http://i.imgur.com/2YpkRjy.png)

![[+]](https://sinister.li/images/modern/collapse_collapsed.png)


It serves two purposes. One, it keeps my knowledge sharp, Two, it kills time when I'm bored