Skip to content
All library documents

Comparing Binary and Ternary Search Speed in a Repeated Test

Article MQL5 code base

Summary

The document describes a small program that implements binary search and ternary search, then compares their run times. It says the test runs 30 times on different arrays, reports each test result, and displays total time for each search method. The reported conclusion is that ternary search is nearly one and a half times faster in this test.

This is a programming benchmark rather than a trading strategy, but the comparison may interest researchers choosing search routines for data-processing tools. The document gives no array sizes, data-generation details, hardware, implementation specifics, or statistical treatment of the timings. Its speed claim therefore applies only to the described but underspecified test and should not be taken as a general result: search performance depends on input, implementation, and environment.

Key ideas

  • The program implements binary search and ternary search for comparison.
  • It repeats the timing test 30 times on different arrays.
  • The document reports that ternary search was nearly one and a half times faster in this test.
  • The benchmark omits array sizes, implementation details, and hardware context.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.