Question 5
The following pseudocode is executed using the "Library" dataset. What does the count represent at the end of execution?
D = { }, count = 0while (Table 1 has more rows) { Read the first row X from Table 1 if (isKey(D, X.Author)) { D[X.Author] = D[X.Author] ++ [X.Name] } else { D[X.Author] = [X.Name] } Move the row X to Table 2}foreach i in keys (D) { if (length(D[i]) ≤ 2) { count = count +1 }}Number of pairs of authors who wrote more than two books
Number of authors who wrote at most two books
Number of pairs of authors who wrote more than one book
Number of authors who wrote more than two books