Questions tagged [lower-bound]

In mathematics, especially in order theory, a lower bound of a subset S of some partially ordered set (K, ≤) is an element of K which is less than or equal to every element of S.

A subset S of a partially ordered set K may fail to have any bounds or may have many different upper and lower bounds. By transitivity, any element less than or equal to any lower bound of S is again a lower bound of S. This leads to the consideration of greatest lower bounds (or infima).

213 questions
-3
votes
2 answers

Lower_bound gives other result

testing lower_bound function in c++ Im getting weird result after running this code in Ideone. What am I doing wrong? is auto usage correct here? code : vector a(5); a.clear(); rep(i,0,5){ a[i]=i+1; cout<
Akhil
  • 61
  • 8
-3
votes
2 answers

using lower_bound or upper_bound on Structure in C++

#include #include using namespace std; struct arr { int a;int b; }a[1000]; bool comp(arr &lhs, arr &rhs) { return lhs.a < rhs.a ; } int main() { int n,i ; sort(a,a+n,comp); int ind=…
-4
votes
2 answers

lower_bound acts weirdly in the function and normally in the main()

I have this piece of code: int main() { const vector sorted_strings = { "zzzу", "zzzzу", "zzzzzу", "zzzzzzzу" }; cout << *lower_bound(begin(sorted_strings), …
alekscooper
  • 795
  • 1
  • 7
  • 19
1 2 3
14
15