Skip to content

Commit 3cd851d

Browse files
committed
[cpp][15_bsearch] comments on IterT.
1 parent 7d24600 commit 3cd851d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

c-cpp/15_bsearch/bsearch.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
enum class BsearchPolicy { FIRST, LAST, UNSPECIFIED };
1212

13+
// Liam Huang: The algorithm works right with iterators that meet the ForwardIterator requirement,
14+
// but with a bad time complexity. For better performance, iterators should meet
15+
// the RandomAccessIterator requirement.
1316
template <typename IterT,
1417
typename ValueT = typename std::iterator_traits<IterT>::value_type,
1518
typename Compare>

0 commit comments

Comments
 (0)