A problem that i cant find solution, someone help me..!

Often is presented the need of search of k keys in a sorted table of n elements. Draw and are analyze three algorithms of mass search, where that is the keys must search with one call of algorithm and no with successive k calls. The three algorithms must support in sequential search, the binary search and search of interjection.

A problem that i cant find solution, someone help me..!

Let us say you have boxes with marbles in it and that they have been placed in such a way that the first box contains the least amount of marbles and sorted, the last box would contain the most marbles.
Now someone asks you : "Find the box with 14 marbles in it!".
What would you do?
sequential : start with the first box, open it, count the marbles, if the count equals 14 you have found the box, if not continue with the next box until the last box.
binary : Pick out the box in the middle, count the marbles, if the count equals 14 you have found the box, if not you know (depending on the count you found) that the box you are looking for must be in the higher part or the lower part of your row of boxes. Again pick a box from that part and look inside to count etc.
interjection search? never heard of.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.