Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Passing a Method Name to a Method, Redux Date: Thu, 23 Jun 2011 17:34:50 -0700 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 24 Jun 2011 00:34:52 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="20GYBuezvHpp83lA3Rh62Q"; logging-data="17068"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ggdmhp2hRX2M/t+StLITV1WAtvFfU61E=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:DS9tDvu5lY0XZzOg8lc/Fkdyen4= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5618 On 6/23/2011 4:03 PM, Gene Wirchenko wrote: > search. The times for sequential searching are only a bit worse than > for binary searching. Treeset searching is about 20% faster. Any > explanations? Why does your TreeSetSearch() call SequentialSearch? Doesn't that defeat the purpose of your timing comparisons? I'm also not following the parsing you are doing at all. What is the goal of that method? static void ParseTreesetSearch() { int xScan = 0; boolean fBuildingIdent = false; boolean fInIdentChars; String cIdent = ""; // fussy init while( xScan < cParseString.length() ) { char CurrChar = cParseString.charAt( xScan ); fInIdentChars = SequentialSearch( CurrChar ); ^^^^^^^^^^^^^^^^ if( TreesetSearch( CurrChar ) ) // different code Odd call indicated above. Doesn't that just do the exact same thing that TreesetSearch does?