Hello I have a binary search function and I want to prove that it has Logarithmic complexity.
I have no idea how to prove this and would really use some help
Here are my execution times for the function:
time of execution: 3.1000000000024064e-06
time of execution: 3.099999999998937e-06
time of execution: 4.600000000000437e-06
time of execution: 7.500000000000562e-06
time of execution: 1.559999999999756e-05
time of execution: 1.8299999999998873e-05
time of execution: 3.210000000009039e-05
time of execution: 4.4200000000493844e-05
it is done in order for n=10, n=100 up to n=100000000
I read here that an algorithm is said to run in logarithmic time if its time execution is proportional to the logarithm of the input size.
I understand it but I want to prove it on my example using math and i kinda suck at math :/
If there is no possible way to do this and I am mistaken I would like to at least have some kind of way to show how does my execution time grows depending on the input size.