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
157 - Route Finding
Moderator: Board moderators
-
- New poster
- Posts: 45
- Joined: Mon Jul 14, 2003 9:42 pm
- Location: Zoetermeer, The Netherlands
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).
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).