DEV Community

Discussion on: Intro to Binary Search

Collapse
 
nerwosolek profile image
Tomasz Gieorgijewski

Good job! Have you tried recursion version of binary search?
Yeah, data must be sorted, so if you don't know the data you will have to sort it anyway yourself which get it down to O(n log n). So simple linear search would be good enough then.

Collapse
 
racheladaw profile image
Rachel Williams

Thanks for reading Tomasz! No I haven't tried implementing the recursive version yet, but I will definitely try it out. Thank you for the feedback!