Replies: 1 comment
-
|
Recursive implementations, in general, are more expensive than iterative implementations for the same algorithm. However, binary search does a very small number of comparisons, which might make the difference between the two versions insignificant. You can try it yourself. Call each version a large number of times and measure the time and see if the difference is noticeable or not. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
which has better running time recursive or iterative binary search?
Beta Was this translation helpful? Give feedback.
All reactions