8 ms·
That looks like three lines to me.
by mellavora 4y ago
That looks like three lines to me.
- faho 4y agoThe first two lines are setup, real code would already have done that. You could maybe count the import, but you'd have to do that once and could do multiple bisections, so it's amortized. Setting the variable doesn't count because you do, of course, need a variable to perform an operation on a variable. Sorting the array also wouldn't count because you can't use binary search if the array isn't sorted.