In this program, we will create an array of integer elements then we will read an item from the user and search the item into the array using the interpolation search technique.
Note: Interpolation search is used to search an item into a sorted array.
Program/Source Code:
The source code to search an item into the array using interpolation search is given below. The given program is compiled and executed successfully.
Output:
Explanation:
Here, we created an array of the integer with 5 elements, and then we read the item from the user.
After that, we searched the item into the array using the interpolation search technique and print the index of the item into the array.
need an explanation for this answer? contact us directly to get an explanation for this answer