void addLast(String xPlace, int xWeight, int xColor). Note: the value of xWeight must be bigger than 0.
void f1() - Do not edit this method. Your task is to complete the addLast(...) method above only.Output in the file f1.txt must be the following:
(G,7,-1) (H,6,7) (C,4,5) (X,8,-9) (1,5,8)
• void f2()-Suppose the list contains at least three nodes, delete the first three nodes. Output in the file f2.txt must be the following:(0,4,7) (L,1,-5) (E,9,2) (0,7,6)
(Q,7,6)
1
void f3()-Suppose the list contains at least 3 elements. Move the third element to the end of the list. Output in the file f3.txt must be the following:
(A,1,-3) (B,9,2) (D,2,6) (E,9,4) (Q,4,5) (R,3,7)
(Α,1,-3) (Β,9,2) (Ε,9,4) (Q,4,5) (R,3,7) (D,2,6)
void f4()-How many Bikes are there in the list satisfying: color > 0?The output in the f4.txt file should be as follows:
(G,2,-2) (H,1,3) (1,3,7) (1,4,5) (K,5,6) (L,6,8)
5
void f5()-Delete the first element, then sort the elements descending by weight. The content of the output file f5.txt must be the following:(N,6,1) (Α,9,3) (1,4,-2) (5,7,5) (D,3,9)
(A,9,3) (5,7,5) (1,4,-2) (0,3,9)
+ 80%
Zoom
Activate Windows
Go to Settings to activate Windows. Close