Found 3 Articles for Searching Algorithm

Introduction to Searching Algorithms

Samual Sam
Updated on 30-Jul-2019 22:30:23

8K+ Views

The searching algorithms are used to search or find one or more than one element from a dataset. These type of algorithms are used to find elements from a specific data structures. Searching may be sequential or not. If the data in the dataset are random, then we need to use sequential searching. Otherwise we can use other different techniques to reduce the complexity. In this Section We are going to cover − Binary Search Exponential Search Interpolation Search Jump Search Linear Search Ternary Search

Ternary Search

Rishi Raj
Updated on 15-Jun-2020 14:50:10

3K+ Views

Like the binary search, it also separates the lists into sub-lists. This procedure divides the list into three parts using two intermediate mid values. As the lists are divided into more subdivisions, so it reduces the time to search a key value.The complexity of Ternary Search TechniqueTime Complexity: O(log3 n)Space Complexity: O(1)Input and OutputInput: A sorted list of data: 12 25 48 52 67 79 88 93 The search key 52 Output: Item found at location: 3AlgorithmternarySearch(array, start, end, key)Input − An sorted array, start and end location, and the search keyOutput − location of the key (if found), otherwise wrong ... Read More

Exponential Search

Paul Richard
Updated on 15-Jun-2020 14:10:42

4K+ Views

Exponential search is also known as doubling or galloping search. This mechanism is used to find the range where the search key may present. If L and U are the upper and lower bound of the list, then L and U both are the power of 2. For the last section, the U is the last position of the list. For that reason, it is known as exponential.After finding the specific range, it uses the binary search technique to find the exact location of the search key.The complexity of Exponential Search TechniqueTime Complexity: O(1) for the best case. O(log2 i) ... Read More

1
Advertisements