the best algorithm for search is binary search where time complexity is o(logn) where input should be in sorted order.
If we use std::find , whether elements should be in sorted order? if not what is the datastructure will find function use?
Time complexity of find is o(logn)
Hi… so its not necessary that elements should be sorted only for find function… in case of unsorted elements a simple linear search is being implemented in that case…
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.