SEARCHING ALGORITHMS
Searching algorithms are fundamental in computer science, enabling efficient retrieval of data
from various structures. Over time, numerous algorithms have been developed, each tailored
to specific types of data and search requirements.
Classic Searching Algorithms:
1. Linear Search:
• Description: Examines each element in a list sequentially until the target element is found or
the list ends.
• Use Case: Suitable for small or unsorted datasets.
• Time Complexity: O(n), where n is the number of elements.
2. Binary Search:
• Description: Efficiently searches a sorted list by repeatedly dividing the search interval in
half.
• Use Case: Ideal for large, sorted datasets.
• Time Complexity: O(log n).
3. Jump Search:
• Description: Involves jumping ahead by fixed steps and then performing a linear search
within a smaller range.
• Use Case: Useful for uniformly distributed, sorted arrays.
• Time Complexity: O(√n).
4. Interpolation Search:
• Description: Estimates the position of the target value within a sorted array based on the
value’s proximity to the bounds.
• Use Case: Effective for uniformly distributed, sorted datasets.
• Time Complexity: O(log log n) in the best case; O(n) in the worst case.
5. Exponential Search:
• Description: Combines binary search with an exponential step to find the range where the
target may exist.
• Use Case: Efficient for unbounded or infinite lists.
• Time Complexity: O(log n).
Contemporary Searching Algorithms:
1. A Search Algorithm:
• Description: An informed search algorithm that finds the shortest path between nodes using
heuristics to guide its search.
• Use Case: Widely used in pathfinding and graph traversal, such as in AI for games and
navigation systems.
• Time Complexity: Depends on the heuristic; optimal with admissible heuristics.
2. Aho–Corasick Algorithm:
• Description: A string-searching algorithm that matches elements of a finite set of strings
within an input text simultaneously.
• Use Case: Ideal for searching multiple patterns in large texts, such as in intrusion detection
systems and text editors.
• Time Complexity: Linear in the length of the input text plus the number of matches.
Key Differences Between Old and New Searching Algorithms
MIND MAP
References:
https://www.geeksforgeeks.org/searching-algorithms/
https://www.geeksforgeeks.org/a-search-algorithm/
https://www.geeksforgeeks.org/aho-corasick-algorithm-pattern-searching/
https://www.freecodecamp.org/news/search-algorithms-explained-with-examples-in-java-
python-and-c/
https://www.analyticsvidhya.com/blog/2021/09/searching-in-data-structure-different-search-
methods-explained/
https://thetechartist.com/searching-algorithms-overview/
https://www.udacity.com/blog/2020/07/search-algorithms-explained.html