954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

three algorithms=sequential search, the binary and interjection..??Problem!

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.

apaciboy
Newbie Poster
4 posts since Dec 2008
Reputation Points: 10
Solved Threads: 0
 
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.

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You