4 ms·
If the base type of the set is a bit set, the function need only worry about the position of each bit, and not the intended type. Of course, if the set has con
by Roboprog 13y ago
If the base type of the set is a bit set, the function need only worry about the position of each bit, and not the intended type. Of course, if the set has content in hash buckets (or a similar scheme), you would need to pass in some kind of comparator function/callback.
I say this as a former C programmer used to doing such things to make library routines like "bsearch()" work.
Too many things in Java rely on subclassing, rather than functional composition.