Upperbound refers to the maximum limit or the highest capacity a system can handle.
Questions tagged [upperbound]
137 questions
81
votes
10 answers
rationale for std::lower_bound and std::upper_bound?
STL provides binary search functions std::lower_bound and std::upper_bound,
but I tend not to use them because I've been unable to remember what they do,
because their contracts seem completely mystifying to me.
Just from looking at the names,
I'd…

Don Hatch
- 5,041
- 3
- 31
- 48
39
votes
1 answer
What's the maximum pixel value of CSS width and height properties?
What are the largest valid px values that CSS width and height properties accept?
(I'm currently building a webapp that creates a very large zoomable container element and I want to know what are the actual limits.)

Stas Bichenko
- 13,013
- 8
- 45
- 83
21
votes
9 answers
Java equivalent of c++ equal_range (or lower_bound & upper_bound)
I have a List of object sorted and I want to find the first occurrence and the last occurrence of an object. In C++, I can easily use std::equal_range (or just one lower_bound and one upper_bound).
For example:
bool mygreater (int i,int j) { return…

RoundPi
- 5,819
- 7
- 49
- 75
19
votes
3 answers
Difference between basic binary search for upper bound and lower bound?
In the article http://community.topcoder.com/tc?module=Static&d1=tutorials&d2=binarySearch, the author discusses binary search. He makes a distinction between finding the lowest value where something is true, and the highest value where something is…

John Targaryen
- 1,109
- 1
- 13
- 29
13
votes
4 answers
STL MAP should use find() or [n] identifier to find element in map?
I am confused which is more efficient?
As we can access map directly, why do we need to use find?
I just need to know which way is more efficient.
#include
#include

mister
- 3,303
- 10
- 31
- 48
11
votes
1 answer
how type variable allowing wrong type?
package org.my.java;
public class TestTypeVariable {
static void typeVarType(T t, A a){
System.out.println(a.getClass());
System.out.println(t.getClass());
}
public static void main(String[] s){
…

Atul
- 521
- 1
- 7
- 20
8
votes
1 answer
Kotlin generics multiple upper bounds (as OR / union construct)
I'm wondering whether it's possible to create a generic class, that accepts an instance of type T, which is limited to (e.g.) an instance of String or an instance of List. See the following pseudo code as an example:
data class Wrapper

Robin Trietsch
- 1,662
- 2
- 19
- 31
8
votes
7 answers
Get the immediate minimum among a list of numbers in python
How can I get the next minimum value to a value provided in python? Is there any inbuilt functions for it?
>>>num_list=[1,2,3,4]
>>> min(num_list)
1
>>> max(num_list)
4
How can I find the next lowest to 3 or next greatest to 2 ? The expected…

cutteeth
- 2,148
- 3
- 25
- 45
8
votes
4 answers
Powerbuilder Dynamic Array Manipulation
string array[]
long lBound, uBound
lBound = LowerBound(array[]) // = 1, empty array value
uBound = UpperBound(array[]) // = 0, empty array value
array[1] = 'Item 1'
array[2] = 'Item 2'
array[3] = 'Item 3'
lBound = LowerBound(array[]) // =…

glasnt
- 2,865
- 5
- 35
- 55
7
votes
1 answer
How to use lower_bound(upper_bound) to find position of any number in array?
For example, I have an array with elements 1,7,9,23,34,47,67,89,123,234,345,567.
I need to know the position of 123.

Nodar Maruashvili
- 103
- 1
- 2
- 6
7
votes
2 answers
Postgres int4range upper bound unexpected value
Using PostgreSQL 9.4:
SELECT x, lower(x), upper(x) FROM (SELECT '[1,2]'::numrange x) q;
> [1,2] | 1 | 2 -- looks OK
SELECT x, lower(x), upper(x) FROM (SELECT '[1,2]'::int4range x) q;
> [1,3) | 1 | >>3<< -- this is unexpected
Let's check…

damisan
- 1,037
- 6
- 17
6
votes
1 answer
Class of a generic Java type cannot be assigned to a variable whose Class type is upper bounded by a generic super type
I use Java 8. In my design a have a few simple classes which model value parameters such as FloatParameter or EnumParameter. A have a common generic super class of these classes (GenericParameter) which implements parameter name and its…

Adam Jurčík
- 63
- 7
6
votes
2 answers
Upper bounds and Lower bounds in Algorithms
I saw several articles describing upper bound as Best Case and Lower bound as Worst Case. Meanwhile some articles have given explanations for Upper /Lower bound of Worst Case.
So basically this got me asking three questions:
What exactly are…

Shav_I
- 126
- 1
- 7
5
votes
1 answer
Binary searching for a vector in vector>
I have a vector events, which consists of vector of events, such as:
events = [[1,3,2],[2,4,3],[4,5,2],[10,20,8]]
where events[i] is of the format [startTime_i, endTime_i, value_i] (inclusive). All the events are sorted in such a way that jth…

R Karandikar
- 51
- 1
5
votes
4 answers
vb6 array with -1 for upper bound
Some functions such as Split() will return an array with -1 for the upper bound and zero for the lower bound if the array has no items, eg:
Dim s() As String
s = Split("", ",")
Debug.Print UBound(s)
Debug.Pring LBound(s)
In this case UBound(s)…

bugtussle
- 1,416
- 11
- 15