I need correct output for following test data:
--
DEPEND A B C
DEPEND B D E G
DEPEND C G E K
DEPEND K Z
DEPEND E S
INSTALL A
LIST
REMOVE A
LIST
INSTALL B
INSTALL C
INSTALL A
REMOVE A
INSTALL K
LIST
REMOVE C
REMOVE A
INSTALL A
LIST
INSTALL C
REMOVE A
LIST
END
--
following are my program's output
--
DEPEND A B C
DEPEND B D E G
DEPEND C G E K
DEPEND K Z
DEPEND E S
INSTALL A
Installing Z
Installing K
Installing S
Installing E
Installing G
Installing C
Installing D
Installing B
Installing A
LIST
Z
K
S
E
G
C
D
B
A
REMOVE A
Removing A
Removing C
Removing K
Removing Z
Removing B
Removing G
Removing E
Removing S
Removing D
LIST
INSTALL B
Installing G
Installing S
Installing E
Installing D
Installing B
INSTALL C
Installing Z
Installing K
Installing C
INSTALL A
Installing A
REMOVE A
Removing A
INSTALL K
K is already installed.
LIST
G
S
E
D
B
Z
K
C
REMOVE C
Removing C
Removing K
Removing Z
REMOVE A
A is not installed.
INSTALL A
Installing Z
Installing K
Installing C
Installing A
LIST
G
S
E
D
B
Z
K
C
A
INSTALL C
C is already installed.
REMOVE A
Removing A
Removing C
Removing K
Removing Z
LIST
G
S
E
D
B
END
--
I think I did look at the problem description very carefully and several times. but after submit my problem, I got Runtime Error, I think it's because I don't allocate enough memory to restore each item's data. After I fixed it, I got Wrong Answer now... I tried several times but it didn't work, now I want to know...when we installing or removing some components, would their display order make the difference though it's a special judge problem?
Thanks anyway.

