## Question

###### Question: How can I solve it in "Java program"?, i need test code also. Define Pi...

Question: How can I solve it in "Java program"?, i need test code also.

Define Pi to be a parking lane i in a parking lot and carj to be the jth car; where the number of lanes in a parking lot is 4 and there are 7 cars to park. 1<= i<=4, and Cj: 1<=j<=7. Assume that all lanes are of the same length, and all cars are also of the same length, hence, the same number of cars could be lined up in each lane. Only 5 cars can be lined up in each lane. However, different lanes have different lining up rules according to their data structures. The first parking lot lane is an array, the second is a single listed, and the third is a stack.

Parking lot line - Structure

P1 - Array

P2 - Single Linked List

P3 - Stack

When a car arrives to the parking lot, the valet parking lot staff insert the car in one of lanes. However, customers may also ask the staff to get their cars back later. Keep in mind that any (inserting/ removing) operation (corresponding to moving any car into or out of any lanes) cost 1 KD.

Test the program on each data structure using the following Insert operations.

lane operation - Car Number

Insert - C1

Insert - C4

Remove - C1

Insert - C5

Insert - C7

Insert - C3

Insert - C2

Remove - C2

Insert - C1

Remove - C7

Insert - C6

Remove - C1