Q29Single correct6 Marks24 Dec 2023
The following pseudocode is executed using the "Shopping Bills" dataset. At the end of the execution, the dictionary D captures the following information: for each category i, D[i][j] stores the list of prices of item j across all bills. Choose the correct code fragment to complete the pseudocode.
```
D = {}
while(Pile 1 has more cards){
Read the top card X in Pile 1
foreach a in X.ItemList{
if(isKey(D, a.category)){
if(isKey(D[a.category], a.itemName)){
*** Statement I ***
}
else{
*** Statement II ***
}
}
else{
D[a.category] = {}
*** Statement II ***
}
}
Move card X to Pile 2
}
```
————————————————————————————————————————————————————————————