Find duplicates before inserting into doubly linked list

I have a text file that needs to be read by command line arguments. The text are all numbers and can have multiple numbers on one line separated by a space. I cannot use an array or sort the numbers.

So say I have a text file, listNums.txt:
12
473 8 29
30 1
8
248 17 55
29 84
5


Basically I need to read one number, find out if its odd or even by dividing by 2, search the odd or even doubly linked list that it would go into to see if its in there, if its not then add it to the bottom of the list.

Help!

Thanks!
Last edited on
Why don't you start off by writing the code to read the file, a line at a time...
... or read a number at a time ...
Topic archived. No new replies allowed.