Big O run time analysis

By   10-15-2017 · 1 minute read · 116 words


Below is an analysis of how long Simple search and Binary search run times would take to run given a scenario.

Algorithm running at different rates.

How long will simple search take and binary search take with 1 billion (1000000000) elements? Assume that each element takes 1 ms to process.

Simple search runtime

Converting into seconds

$1000000000\over1000$ = 1000000 seconds

Converting into mins

$1000000\over60$ = 16666.666 minutes

Converting into hours

$16666.666\over60$ = 277.77 hours

Converting into days

$277.77\over24$ = 11.57 days

Binary Search runtime

$\log _{2} 1000000000$ = 29.89 ms

Table of search compared

number of elements Simple Search Binary Search
100 100 ms 7 ms
10,000 10 seconds 14 ms
1,000,000,000 11 days 32 ms

big-o   runtime  

comments powered by Disqus