Hi, I have a problem, if any body can solve it, please help me please urgently.Thanks...
You are going to implement the doubly linked list (DLL). Your task is to simulate a workbench robot for wagon construction. Assume your DLL is a train with red, green and blue wagons. The commands of your menu are as follow:
IR Insert a red wagon from the head.
IB Insert a blue wagon from the head.
IG Insert a green wagon from the head.
RR Remove all red wagons from the train.
RB Remove all blue wagons from the train.
RG Remove all green wagons from the train.
MRB Get the first red wagon and move it to the next of the first blue wagon.
MRG Get the first red wagon and move it to the next of the first green wagon.
MBR Get the first blue wagon and move it to the next of the first red wagon.
MBG Get the first blue wagon and move it to the next of the first green wagon.
MGR Get the first green wagon and move it to the next of the first red wagon.
MGB Get the first green wagon and move it to the next of the first blue wagon.
DW Duplicate wagons.
E.g.: If your train is R-G-R-B-G,
after the DW comment it will become R-R-G-G-R-R-B-B-G-G
NR Print the number of red wagons.
NB Print the number of blue wagons.
NG Print the number of green wagons.
P Display the train in forward direction.
Q Quit & delete the DLL.