?
Solved

Search technique using for J2ME Enumeration

Posted on 2006-04-26
4
Medium Priority
?
2,036 Views
Last Modified: 2012-05-05
Whats the best search technique to use to loop through an Enumeration instance which contains 100 or so Contact objects from the JSR-75 PIM API.

http://www.j2medev.com/api/pim/javax/microedition/pim/Contact.html

References to URLs are useful. Thanks!
0
Comment
Question by:meinnit
2 Comments
 
LVL 13

Accepted Solution

by:
bglodde earned 1000 total points
ID: 16554320
With only 100 Contacts, I'd just loop the enumeration and compare the relevant search terms against the various parts of the Contact.
0
 
LVL 6

Assisted Solution

by:WilliamFrantz
WilliamFrantz earned 1000 total points
ID: 16673233
If you are doing multiple searches, read the enumeration into an array, sort it, and use a binary search algorithm.  It's much faster than repeatedly looping through the content.

http://en.wikipedia.org/wiki/Binary_search

If you are only doing one search, then don't bother.  Just loop through sequentially.
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
DECT technology has become a popular standard for wireless voice communication. DECT devices are not likely to be affected by other electronic devices and signals because they operate in a separate frequency-band.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question