TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jasen Betts
from: Neil Heller
date: 2004-06-08 10:28:02
subject: Take out dups in a list

(Continued from previous message...)

JB> NH>             second_list[counter2] = first_list[counter1];
JB> NH>             counter1++;
JB> NH>             counter2++;
JB> NH>         } else {
JB> NH>             counter1++;
JB> NH>         }
JB> NH>     }
JB> NH> }


JB>the only problem I see is there's no anouncement of the number of
JB>unique valies found in the list...

You must order your beer with egg in it.

JB>immangine the first array had {-1;-1;0;0}  in it.

JB>the second array gets {-1;0;0;0;}
JB>(becaue you initialise it to all 0 in main)
JB>but it's not immediately obvious wither the second element is a
JB>number form the first list or marks the end...

True.  In thinking about that problem the only way (that I can see) to 
overcome it would be to dynamically create an array based on the size of 
the input data set OR do a linked list thing.

þ CMPQwk 1.42 999

--- Maximus/2 3.01
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)
SEEN-BY: 633/267 270
@PATH: 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.