Page 2 of 2

Test Case

Posted: Fri Apr 25, 2003 2:45 am
by paulhryu
Here is a test case:

5
A:ab=Bbcdefghijk
B:abc=Ajdef=Cb
C:ab
D:cd=Eg
E:fg=Bf
AaAk
AcAk
AbBb
BaDd
#

The correct output is:
9: Aab=Bbc=Ajk
8: Acdefghijk
3: Ab=Bb
8: Babcdef=Dd

Your program gives:
9: Aab=Bbc=Ajk
8: Acdefghijk
3: Ab=Bb
11: Babcdef=Eg=Dd

thanks..

Posted: Fri Apr 25, 2003 6:34 am
by pokute
Thanks.. I realize my mistake :D

Posted: Tue Mar 16, 2004 10:11 pm
by El-idioto
Paul:
Brilliant example... I had the exact same output as Pokute, and managed to fix my problem using the example.

Thanks a lot!!!


Pokute:
I noticed you use a LOT of memory... I implemented this problem by using linked lists. Although it was quite a bit more complex than using arrays, it will assure my application will still work for problems where the station's names are more complex (and more numerous).