ITEE ITEE-1 | Page 183

(2)Search A “search algorithm” looks for data that matches certain conditions that are given. These include the following types of structures. ●Linear search A “linear search” is a method which checks each set of data in order, starting from the first set and ending with the last set. Search for “6” 4   5   2   7   8   6   1   9   3   10 ① Check whether “6” can be found in the first set of data. ② Check whether “6” can be found in the second set of data. ③ Repeat until “6” is found. ●Binary search A “binary search” is a method which, starting from a central set of data, checks for information by narrowing down whether the targeted item is located before or after the central value. This method is useful when data is in ascending or descending. Search for “6” 1   2   3   4   5   6   7   8   9   10 ① Narrow the choices down to the data located after the center. 1   2   3   4   5   6   7   8   9   10 ② Within 6-10, narrow the choices down to the data located before the center. 1   2   3   4   5   6   7   8   9   10 ③ Within 6-7, narrow the choices down to the data located before the center. Find “6.” 177