KOMPARASI KECEPATAN ALGORITMA SEQUENTIAL DAN BINARY SEARCH BERBASIS VECTOR C++ PADA DATA TERURUT DAN ACAK - Raesya Satria Mikaelana; Fakhrul Arhabur Rizqi; Delviera Gea Florida; Aisyah Nur Ramadhani; Armaylis Arfa; Imam Prayogo Pujiono (Jurnal Informatika Kaputama (JIK), 2026)
This study aims to compare the computational time efficiency between the Sequential Search and Binary Search algorithms implemented using a dynamic data structure (vector) in the C++ programming language . The test focused on a small-scale dataset consisting of 98 random integer elements . The experiment was conducted through two main scenarios, namely searching in unsorted and sorted data conditions, by taking the average execution time of 50 iterations to maintain consistency . The test results show that in the unsorted data condition, Sequential Search is more efficient with an execution time of 4.25 µs . This is significantly faster than Binary Search, which takes a total of 15.40 µs due to the additional computational overhead of sorting the data at the beginning of the execution . Conversely, on sorted data, Binary Search is highly optimal thanks to its logarithmic search space division mechanism, recording an execution time of only 0.85 µs compared to Sequential Search (3.90 µs) . This study concludes that Binary Search is the best algorithm for sorted data, while Sequential Search is more practical and superior for small-scale datasets that have not been organized as it avoids pre-processing.