☑Kizspy.me
d. f4(): In this task, students need to perform the serving function, including dequeue()
function of the OrderQueue and the remove() function in ItemTree. The dequeue()
function returns the first Item in the queue after removes it out of the queue. In f4()
function, if this Item is found in the Item Tree, remove it out of the tree, and then return
its price; if not found, return 0. You also need to call these functions in the f4() function:
dequeue(), search(), remove().
The expected input/output used to test your code are as follows:
INPUT:
7
data.txt
4
Zoom
OUTPUT:
Before
Order Queue:
A, Computer
E, Tablet
B, Keyboard
G, Phone
H, USB
C, Mouse
D, Monitor
Item Tree:
A, Computer, 1500
+ 100%
Close