Questions tagged [upperbound]

Upperbound refers to the maximum limit or the highest capacity a system can handle.

137 questions
0
votes
2 answers

Stl Vector operation on C++ struct

I defined this struct: typedef struct Systems { //stuff... vector list; } System; vector system(100); At a certain point I would like to perform an operation on all the 100 entries of system[i].list[0] or…
altroware
  • 940
  • 3
  • 13
  • 22
0
votes
2 answers

Why do i need explicitly use self-type in the given example?

While reading and trying to get all the concepts behind scalable components in Scala from this, i still can't fully understand why this example should have self type: abstract class Graph { type Node <: NodeLike trait NodeLike { // without…
user1078671
0
votes
2 answers

Protect C++ Variables from Getting OverFlow ? if value is less UpperBound of any DataType

I want to protect my variable from storing overflow values . I am Calculating Loss at every level in a tree and at some stages. it gives values like 4.94567e+302 ;Is this value Correct .If i compare it(Like Minimum ,Maximum etc) with any other…
Charlie
  • 4,827
  • 2
  • 31
  • 55
0
votes
6 answers

How can I find the first element of a map where key is greater than val

I have a map (say T==string) and I wanted to find the first element of the map such that the key was greater than a given number. I looked in and find upper_bound and lower_bound. Strangely I can get the first above using…
statquant
  • 13,672
  • 21
  • 91
  • 162
-1
votes
1 answer

incorrect behavior of upper_bound

vector v = {0,1,3,2}; auto x = upper_bound(v.rbegin(), v.rend(), 1); cout<<(*x); This block of code gives output 24576 vector v = {0,1,3,2,2}; auto x = upper_bound(v.rbegin(), v.rend(), 1); cout<<(*x); This block gives output 2. Why?
-1
votes
4 answers

Questions about the upper bound of generic in java

please see the following code: import java.util.ArrayList; public class Animal{...} public class Dog{...} public class TestAnimal{ public static void killAll(ArrayList animals){ System.out.println("animals are…
-1
votes
1 answer

Trying to find the upper bound using Binary search, even though the output is correct , compiler still throwing error

I was solving a question which required me to find the upper bound of an value in 1st array in 2nd array,so i used bianry search. now even though the expected output and my code's output match perfectly, the compiler is throwing an error. here is my…
Abhi
  • 1
  • 1
-1
votes
1 answer

Python: set lower- and upperbounds, remove them from array, and calculate the mean of new array

enter image description here I need help to figure this out! I am pretty new to coding python. I have set in the print statement my upper and lower bounds to be 25 and 15, i have then tried to define 2 lines, that removes the number that exceeds the…
sedative
  • 1
  • 2
-1
votes
1 answer

Upper bound with recursion tree

I need to find asymptotic upper bound using recursion tree. The relation is T(n) = T(n-1) + 1/n I suppose that it is O(logn) but i cannot show it. Any suggestions?
-1
votes
2 answers

upper bound - display

This is an idea I got in to my mind, All the display devices(screens which have pixels etc...) have an upper bound for the amount of various images they can generate. as an example 1024*728 - 32 bit pixel display can only show (2^32)^(1024*768)…
Buddhi
  • 2,224
  • 5
  • 32
  • 43
-1
votes
1 answer

proving upper bound complexity for prim's algorithm

I would like to know how can you prove an upper bound on the time complexity of Prim's algorithm. I know that the time complexity of the Prim's algorithm is O(|E| log |V|),where E is the edge and V is the vertex, but what does it mean by the upper…
-1
votes
2 answers

Recurrence relation: iteration solving

There is a recurrence relation as following: T(n) = 2 T(n-1) + O(1) for n > 1 otherwise, its T(n) = O(1) By iteration , so far I got like, T(n) = 2(2T(n-2) + 1) + 1 --- 1 T(n) = 2(2(2T(n-3) + 1) + 1) + 1 ---- 2 T(n) = 2(2(2(2T(n-4) + 1) + 1) + 1)…
Dee
  • 483
  • 2
  • 11
  • 24
-1
votes
4 answers

method argument suitable for adding to a upper-bound ArrayList

the following code is part of an abstract class which is meant to be subclassed to manage a specific kind of Shape. (it's actualy a repository for a specific class but that's not relevant now) protected ArrayList
Midge
  • 51
  • 3
-2
votes
1 answer

Finding asymptotic upper and lower bound?

If we assume T(n) is constant for small n, how can we find the solution of this function? T(n) = T(n−2) + 2logn So far, I am unable to find a way to represent the whole function. Can you please help me? I really want to understand.
-3
votes
1 answer

what do upper_bound() do?

I am begineer and I dont understand the following. In the code I got the output Now my question is since the upper_bound() operator gives the index of greater value how did the output gave the answer of upperbound as 7 and not 1.
1 2 3
9
10