I've just looked at every similar question in this forum and couldn't find one that helped me, so I'm posting my own. I've tried everything (except GDB because I don't quite understand find without generate for it keeps prompting for numbers - and I don't even know if that's right- and it never stops, so I just don't use it and I don't know if there's a way to run GDB with find and generate together) and nothing worked out.
Anyways, my code always returns false (unless I change the last line on my binary search to "return true" - in that case it always returns true) and I don't know if the problem is in sort or in search. From what I've been seeing on the forum, both of them seem correct, but I may be wrong.
Also, I put the "break" in the while loop because it was the way I found to make it stop being an infinite loop. And I'm not sure if I really need the last else block there either.
[Code: For academic purposes, I deleted the code after having this question answered.]