what's the alternative?
Should I write by myself?
The reason there is no vector::find
is because there is no algorithmic advantage over std::find
(std::find
is O(N)
and in general, you can't do better for vectors).
But the reason you have map::find
is because it can be more efficient (map::find
is O(log N)
so you would always want to use that over std::find
for maps).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With