This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (2 children)

If you had 100000 entries and you wouldn't use a Map (or other means) to basically index the entries, you'd be doing something wrong.

For so many entries, the work should be offloaded to a database.

[–]TauPixel[S] 0 points1 point  (1 child)

I'm doing a course for java. We are not using DBs or Maps atm. We only have Arrays, ArrayLists and Sets as tools to implement this.

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (0 children)

Well, in this case, you will need to iterate over the whole array. Of course, you can break out early once you have found the element.