RECENT NEWS from the US Coast Guard, regarding the fate of the missing container ship, El Faro, is not encouraging. Unfortunately for the 33 crew members, the search and rescue operations have not yet found signs of life. This seems to confirm the worst, that the ship sank after it encountered Hurricane Joaquin near The Bahamas.
Could you imagine the mammoth task of scanning a large area of the sea surface, looking for signs of the vessel and its crew? Even worse in the aftermath of a storm, with unfavourable conditions, it is no wonder that the search operation would take significant resources, and perhaps challenge the efforts of a superpower! With our own occasional history of lost fishermen, we should all hope and pray for the safe delivery of the missing crew.
In the context of ICT, the concept of an efficient search is something that we do so often that we may take it for granted. For example, you could be searching for:
* a file on your computer, based on its name, or its contents;
* online content, such as a webpage based on its contents or other criteria.
To quickly find the needed information, you should specify some unique criteria. For example, to find a file that contains poetry, you could search for a specific line from the poem.
What happens when you are searching for a person’s name that is printed in the telephone directory? As you skip through the pages, you continually check whether you should backtrack or continue ahead to reach the correct page.
Here is a very fast technique, an algorithm, to always find the correct page.
Step 1) Go to the middle page, and check the result.
Step 2) Found the correct page? Congratulations, the search is over!
Step 3) Gone too far ahead? Discard the second half.
Step 4) Not reached it yet? Discard the first half.
Step 5) Use the remaining pages, and return to step 1.
Whether you backtrack or continue ahead, you effectively reduce the amount of work by half.
Interestingly, this technique also works with the popular children’s number guessing game. You are guaranteed, within seven attempts, to guess a number up to 100. Within 20 attempts, you may guess a number up to 1 million!
With the right technique, regardless of the technology, searches can be very efficient, even elegant!
To share your views, contact the author at: www.datashore.net or via The Voice.