mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-02 14:04:20 +00:00
add some algorithm test
This commit is contained in:
parent
bc04943aaa
commit
570b834367
10 changed files with 255 additions and 0 deletions
|
@ -10,6 +10,10 @@ namespace sprout {
|
|||
//
|
||||
// is_decreasing
|
||||
//
|
||||
// recursion depth:
|
||||
// [first, last) is RandomAccessIterator -> O(log N)
|
||||
// otherwise -> O(N)
|
||||
//
|
||||
template<typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_decreasing(ForwardIterator first, ForwardIterator last) {
|
||||
|
|
|
@ -10,6 +10,10 @@ namespace sprout {
|
|||
//
|
||||
// is_increasing
|
||||
//
|
||||
// recursion depth:
|
||||
// [first, last) is RandomAccessIterator -> O(log N)
|
||||
// otherwise -> O(N)
|
||||
//
|
||||
template<typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_increasing(ForwardIterator first, ForwardIterator last) {
|
||||
|
|
|
@ -10,6 +10,10 @@ namespace sprout {
|
|||
//
|
||||
// is_strictly_decreasing
|
||||
//
|
||||
// recursion depth:
|
||||
// [first, last) is RandomAccessIterator -> O(log N)
|
||||
// otherwise -> O(N)
|
||||
//
|
||||
template<typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_strictly_decreasing(ForwardIterator first, ForwardIterator last) {
|
||||
|
|
|
@ -10,6 +10,10 @@ namespace sprout {
|
|||
//
|
||||
// is_strictly_increasing
|
||||
//
|
||||
// recursion depth:
|
||||
// [first, last) is RandomAccessIterator -> O(log N)
|
||||
// otherwise -> O(N)
|
||||
//
|
||||
template<typename ForwardIterator>
|
||||
inline SPROUT_CONSTEXPR bool
|
||||
is_strictly_increasing(ForwardIterator first, ForwardIterator last) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue