Q55Comprehension4 Marks2 Apr 2023
Passage
The following pseudocode is executed using the Shopping Bills dataset. Answer the given subquestions.
```
D = {}
while(Pile 1 has more cards) {
Read the top card X in Pile 1
foreach Y in X.ItemList {
if(isKey(D, Y.Category)) {
if(isKey(D[Y.Category], Y.ItemName)) {
D[Y.Category][Y.ItemName] = D[Y.Category][Y.ItemName] ++ [Y.Price]
}
else {
D[Y.Category][Y.ItemName] = [Y.Price]
}
}
else {
D[Y.Category] = {Y.ItemName : [Y.Price]}
}
}
Move card X to Pile 2
}
```
What will each value `D[J][I]` represent at the end of execution?