Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different kinds of Search mechanisms using Java

 
Mathew Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering as to what kind of searching techniques(eg binary search etc) can be used with Java?

Thanks
Mathew Chen
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any technique you care to implement

Seriously, what do want to search? That will determine how you can go about it.
 
Mathew Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf for your reply.What I wanted to know was if there were certain theoretical concepts to be understood to implement the search technique.For eg I know that binary search is one technique.I was wondering if there is any other technique available.

Thanks again
Mathew Chen
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wikipedia is your friend.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use a basic linear search. In fact, you need to use these in situations where your data has no order. But AFAIK binary search is the best algorithm for situations where the data is sorted.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should look at the JavaDocs for the Java "Collections" API in the java.util package. There you will find all sorts of standard library support for sorting and searching.
The Jakarta commons project has extended that base with a variety of special purpose collections.
You will have to get more specific about what you are searching if you want more detailed discussion.
Bill
 
Mathew Chen
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for your responses.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic