Running time (source code)

= Running time

= Runtime
{synonym}

An <algorithm>'s <running time> is its computational work on an input, measured either as elapsed time on a specified system or as an operation count under a cost model. <Time complexity> expresses how that count grows with input size. For <binary search> in a random-access <sorted array>, halving the candidate interval needs $O(\log n)$ comparisons. The same index-based code on a linked representation need not have that cost. Worst-case, average-case and amortized bounds quantify different questions; a measured duration alone does not prove any asymptotic guarantee.