lower-bound Questions
1
Solved
I would like to do the following:
public class ImmutableList<T> {
public <U super T> ImmutableList<U> add(U element) { ... }
}
That is, given an immutable list of T, you can a...
Evacuate asked 30/5, 2012 at 2:28
3
Solved
It's well-known that the worst-case runtime for heapsort is Ω(n lg n), but I'm having trouble seeing why this is. In particular, the first step of heapsort (making a max-heap) takes time &The...
Reprint asked 4/1, 2011 at 1:42
1
Solved
In effective STL by Scott Meyers (page 195) there is the following line:
"The result of lower_bound must be tested to see if it's pointing to the value you're looking for. Unlike find, you can't j...
Cloying asked 5/1, 2012 at 10:38
2
Solved
I wrote a simple program that sorts in O(n). It is highly memory inefficient, but that's not the point.
It uses the principle behind a HashMap for sorting:
public class NLogNBreak {
public stati...
Pigling asked 23/8, 2011 at 1:7
3
Solved
There are many optimization problems that are known to be NP-hard, such as the traveling salesman problem, MAX-SAT, or finding the minimum chromatic number of a graph. Given a problem of this sort,...
Machinegun asked 28/2, 2011 at 20:31
© 2022 - 2024 — McMap. All rights reserved.