Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ std珠玑 #31

Open
Durant35 opened this issue Sep 6, 2018 · 0 comments
Open

C++ std珠玑 #31

Durant35 opened this issue Sep 6, 2018 · 0 comments

Comments

@Durant35
Copy link
Owner

Durant35 commented Sep 6, 2018

std::lower_bound() & std::upper_bound()

  • 函数lower_bound()在first和last中的前闭后开区间进行二分查找,返回大于或等于val的第一个元素位置(迭代器);如果所有元素都小于val,则返回last的位置
  • 函数upper_bound则返回大于val的第一个元素位置(迭代器)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant