A
A
aimurat9272020-10-24 13:35:39
Programming
aimurat927, 2020-10-24 13:35:39

How to populate this trace table in pseudocode?

The institute was asked to fill in this trace table using pseudocode. I'm sure the pseudo-code you have is wrong, but the instructor insists otherwise. Please help me to resolve the issue. Detailed explanation is welcome! I show exactly what was in the task
5f9402ac36c26425271708.png
5f940354cda8b517730614.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2020-10-24
@saboteur_kiev

IMHO it's wrong, but the pseudo-code is outrageous. Those left arrows and variable names just don't hurt the eyes.
And so, if I understand correctly, you have LoopA counted from 1 to 3, and LoopB from 0 to 0.
Thus, all comparisons are simply incorrect.

Z
Zanak, 2020-10-24
@Zanak

We transfer items from Items to Newitems, provided that they have not been seen before (done = false). To fill in the required table, you need to know the contents of Items, because it can be [1, 1, 1, 1], then as a result we get NewItems = [1], and maybe [1, 2, 3, 4], then it will be transferred in its entirety.
And yes, if I understand the pseudocode correctly, then there are no errors in it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question