• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this simplest searching algorithm ok?

 
Jin Zhang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Do not want to spend time to find complex searching algorithms. I am just using
for (int i = 0; i < allRecordVec.size(); i++) {
Contractor contractor = (Contractor) allRecordVec.get(i);

if( contractor.strictMatches(criteria) ) {
results.add(contractor);
}
}
to get the result. Do you think I can pass the exam with this? I want to justify my design as:
1. It is simple, free from mistake and easy to maintain.
2. This is a small company, the number of records in the data file will not be many.

Thanks.

Cheers,
Zhang Jin
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jin:
I did the same thing you are doing. I think it is reasnable for this project, but I am interested to hear other people opinions.
 
Denis Spirin
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at your instructions; if your app has ALL functionality required by Sun, you should not do anything else.

Moreover, there are a lot of threads devoted to the subject, use Search option.
 
Jin Zhang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hanna,

We are on the same boat... Do let me know when you passed the exam :=)

Cheers,
Zhang Jin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic