if i have a file with names in it in this manner:
John : Bob
Mike : Joe
Mark : John
Bob : Ted
I want the program to read in the file and seperate the names, that is done. However, I am stuck on how to insert the names in to a list based on whether they have been previously read. Basically, I want to comprise little lists and make one big list.
Here are the 3 situations I do not know how to code:
1. if one name appears in an existing little list, add it to the other list that has that name as well.
2. if both names appear in an existing list, connect the two lists.
3. if neither name appears in a list, form a a new list with the two names.
I need an iterator to do this, but I am unsure how to code the IF statements?
Please, any help and advice is greatly appreciated!