Q2.Consider the Table 2 created from the previous question. At the end of execution, what will the value of `countMax` and `occurMax` be?
```
countMax = 0, occurMax = "None"
while(Table 2 has more rows) {
count = 1
Read the first row Y from Table 2
Move Y to Table 4
while(Table 2 has more rows) {
Read the first row Z from Table 2
if(Y.Word == Z.Word) {
count = count + 1
Move Z to Table 4
}
else {
Move Z to Table 5
}
}
Move all the rows from Table 5 to Table 2
if(count >= countMax) {
countMax = count
occurMax = Y.Word
}
}
```@passage
Save
Read
Check
Details
Q2
29 Oct 2023
Q2.Consider the Table 2 created from the previous question. At the end of execution, what will the value of `countMax` and `occurMax` be?
```
countMax = 0, occurMax = "None"
while(Table 2 has more rows) {
count = 1
Read the first row Y from Table 2
Move Y to Table 4
while(Table 2 has more rows) {
Read the first row Z from Table 2
if(Y.Word == Z.Word) {
count = count + 1
Move Z to Table 4
}
else {
Move Z to Table 5
}
}
Move all the rows from Table 5 to Table 2
if(count >= countMax) {
countMax = count
occurMax = Y.Word
}
}
```@passage