Q36.The following pseudocode is executed using the Words dataset. What will `count` represent at the end of execution?
```
A = 10000, count = 0
L = []
while(Table 1 has more rows) {
Read the first row X in Table 1
L = addSomething(L, X)
if(X.Word ends with a full stop) {
if(length(L) == A) {
count = count + 1
}
if(length(L) < A) {
A = length(L)
count = 1
}
L = []
}
Move X to Table 2
}
Procedure addSomething(M, Y)
i = 1
while(i <= Y.LetterCount) {
p = ith letter of Y.Word
if(not(member(M, p))) {
M = M ++ [p]
}
i = i + 1
}
return(M)
End addSomething
```
Save
Check
Details
Q36
6 Aug 2023
Q36.The following pseudocode is executed using the Words dataset. What will `count` represent at the end of execution?
```
A = 10000, count = 0
L = []
while(Table 1 has more rows) {
Read the first row X in Table 1
L = addSomething(L, X)
if(X.Word ends with a full stop) {
if(length(L) == A) {
count = count + 1
}
if(length(L) < A) {
A = length(L)
count = 1
}
L = []
}
Move X to Table 2
}
Procedure addSomething(M, Y)
i = 1
while(i <= Y.LetterCount) {
p = ith letter of Y.Word
if(not(member(M, p))) {
M = M ++ [p]
}
i = i + 1
}
return(M)
End addSomething
```