Hello people, I know how simple binary search works, but how can I do a double binary search, we got students each with a name and a code, I need in my binary search to find a student by name AND by code, using ONLY binary search.How could I do that ???
Please, I don't see how to express the binary search algorithm that is going to exclude another student, with the same name, but a different code.
Please help me, it's very urgent.
It's in C++, just the idea.
Jump to Post
The comparisons are not limited to just one field within a class or structure, you can compare as many class objects such as strings that you want to. In the comparison, if the two names being compared are the same then compare the code.
All 8 RepliesReply to this topic
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.