java.util.TreeSet fed sorted keys, comparisons counted by its Comparator ======================================================================== n = 1023 contains(): worst 18 comparisons, average 9.51 (plain BST on the same input: worst 1023, average 512.0) n = 100000 contains(): worst 31 comparisons, average 16.10 (plain BST on the same input: worst 100000, average 50000.5)