954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

help needed w/ program that simulates a photo album

hi all, i have a programming assignment where i read a text file through command line arguments. i then use that information to get a list of photos (just strings, not actual images) and a list of keywords that correspond to each of those photos.

i am stuck on how to build these lists so i can access them to find a list of keywords for each photo and also to find a list of photos for each keyword. i was fiddling around with arraylists and linkedlists, but i wasn't coming up with the right tactic.

i can clarify any questions anybody has about this problem.

kdott
Newbie Poster
7 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

How about a HashMap> ?
Hashmap has photo name as key, list of keywords as value.
Get list of keywords for a photo is trivial, list of photos for a keyword is easy using contains(keyword) on each of the keyword lists in a loop.

JamesCherrill
Posting Genius
Moderator
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: