The key thing is XPath is *XML* aware. In other words it knows things like
<foo></foo> is the same as <foo/>
and
<x:foo xmlns:x="urn-foo">
<x:bar>blah</x:bar>
</x:foo>
is the same as
<hello:foo xmlns:hello="urn-foo">
<hello:bar>blah</hello:bar>
</hello:foo>
Unless your binary search can guarantee the same then the two aren't performing the same search.
Regards
Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog
nntp://news.microsoft.com/microsoft.public.dotnet.languages.csharp/<#t**************@tk2msftngp13.phx.gbl>
I'm not entirely sure how the xpath performs a search when you specify
criteria, but if you're working with an ordered list, it will almost be
certainly faster to use Binary Search.
That said, I'm guessing the XPath is linear since it doesn't require an
order?
Dan.
"kids_pro" <ki******@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP15.phx.gbl...
Hi there,
When class construct it read content from XML file and store it in
ArrayList.
In my class I had implement Search method using BinarySearch behind.
I want to implement another Method XmlSearch() to search direct from XML
file.
<dictionary>
<lookup key="animal"/>
<lookup key="apple"/>
... more records
</dictionary>
I had read MSDN and be able to implement both search method.
But the question is which method faster?
Any suggestion on these two method?
Cheers,
Kids
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.766 / Virus Database: 513 - Release Date: 17/09/2004
[microsoft.public.dotnet.languages.csharp]