Algoritma Linear Search dan Binary Search Berdasarkan Ukuran dan Kondisi Keterurutan Data - Gilang Abdul Rahman; Dani Indra Junaedi; Deris Santika (LPPM & Fakultas Teknologi Informasi UNSAP, 2025)
This study compares the performance of Linear Search and Binary Search in data retrieval under varying dataset sizes and ordering conditions. Rather than relying solely on theoretical complexity, Binary Search is evaluated end-to-end by including the required sorting step prior to searching. A quantitative experiment is conducted in Python 3.13.9 using shuffled unique integer arrays with sizes ranging from to . Four target scenarios are tested: target located at the beginning, middle, end, and target not found. The primary metrics are execution time and summary statistics (median and mean) computed from repeated runs for each scenario. The results indicate that for a single search on initially unsorted data, the Sorting+Binary approach tends to yield a higher total time than Linear Search because sorting dominates the overall cost, while the binary search component itself remains comparatively small. The contribution of this work is an end-to-end evaluation that accounts for sorting overhead and provides practical guidelines for selecting the appropriate search algorithm across dataset sizes and query scenarios. These findings highlight that algorithm selection should account for data characteristics and preprocessing overhead; Binary Search is most beneficial when data is already sorted or when sorting costs can be amortized across repeated queries.