Confirming your payment

Skip to content

Competency-Based Questions (CBQ) · Question 40 of 40

The Art Club and the Music Club each keep their members' roll numbers as a list in increasing order.

Question 404 marksHard

The Art Club and the Music Club each keep their members' roll numbers as a list in increasing order. For the annual day the secretary needs one list, in increasing order, of everyone in at least one club, with no roll number repeated. She compares the first unused entries of the two lists: she writes down the smaller one and moves past it; if they are equal, she writes it once and moves past it in both lists. Each such test is one comparison. When one list runs out, she copies the rest of the other list without comparing.

Two sorted lists of roll numbers: Art Club 103, 117, 128, 145, 162, 170 and Music Club 109, 117, 131, 145, 158

(i) Write the first four entries of her combined list.

(ii) Which students are in both clubs?

(iii) How many comparisons does she make in all? Why is one pass through the two lists enough?