3.5.3 Suitability for Specific Problems
Algorithms and Problem Solving
Not all algorithms are suitable for all types of problems. The choice of algorithm depends on the problem's specific requirements, such as the need for speed, memory usage, or the nature of the data.
Example: Imagine you're looking for a book in a small, unorganized collection. The best way is to check each book one by one, this is a Linear Search. Now, if your books are neatly arranged alphabetically on a shelf, you can quickly find the book by starting in the middle and deciding which half to search, this is a Binary Search.