Originally posted by James Carman:
Oh, that's O(m + n) where m = len(string) and n = len(invalidString)
Originally posted by Jim Yingst:
[QB]Are you always looking up a specific state, gender, and age? I might define a class combining state + gender into a single key (with equals() and hashCode() methods.
One thing that you maybe able to do is design a collection class that contains mulitple indexing schemes. In this case since you are looking for a range, I might suggest that you use a N-M tree for one of the indexes. Use that structure for age.
HTH
Originally posted by Eugene Kononov:
Hah, you too! People sometimes look at me strangely when I put repeated GC's in front of a measurement like this, but the fact is that I really have observed different results depending on whether I GC 1, 2, or even 3 times. Never obeserved any difference past 3, so far, but it wouldn't surprise me.
I've seen GC kicking in as much as 5 times before it reclaimed everything. Generational garbage collectors became too smart.![]()
This full GC may take 3 to 5 seconds or even longer.
Originally posted by robin harris:
[QB]I am evaluating code that has some very high complexity (McCabe Cyclomatic) and are difficult to test and certify. There are a large number of embedded logic paths (if, else), while and other iterative logic.
I'd be warry about picking this code apart if the corrisponding fan out and Demeter metrics are also out of range. IME, these three numbers often (but not always) travel together as they are an indication of the authors understanding of good OO prinicpals.