Click here to Skip to main content
15,887,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

1) My Question is if there are 1,00,000 files in the Arraylist, List, Vector how will I efficiently pick out the name I want.

How can I do it?

2) This one is same as the above question but the data is stored in the text file and I have to match the required single person name or email from the huge data stored in the file(emails or person name).

will you explain it with some more detailed please
Posted
Updated 22-Sep-10 23:35pm
v5
Comments
Dalek Dave 11-Aug-10 4:06am    
Edited for Readabiliity and Grammar.

For question 1 you should probably use one of the Collection Classes[^] or your own class based on one of these.

For question 2 some form of database is most likely the best option.
 
Share this answer
 
(1) I suppose an HashMap would do the trick.
(2) It strongly depends on the file structure.
:)

[added]

HashMap is based on hash table, that is fairly efficient. See http://en.wikipedia.org/wiki/Hashtable for some info.
[/added]
 
Share this answer
 
v2
Comments
krishnareddy036 23-Aug-10 8:30am    
how can HasMap Solve the problem is their any method are way to search as fast as it can

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900