C++ STL

1.next_permutation()

post-thumbnail

2.lower_bound, upper_bound

post-thumbnail