The following table represents a 2D array called SEMISORTED where each row contains elements sorted in ascending order. The rows are not sorted in relation to each other.

(a).

What is the value of the 2D array SEMISORTED item at index [3][4]

[1](b).

Using pseudocode, write an algorithm that outputs every element in the 2D array SEMISORTED.

[2](c).

Describe, in words or pseudocode, how the algorithm in b) could be modified to efficiently search the 2D array SEMISORTED for an input number K. TRUE is output if K is present and FALSE if K is not present.

[5](d).

Suggest how the 2D array SEMISORTED might be more efficiently searched using a combination of linear and binary search. Also indicate the characteristic of the 2D array SEMISORTED data that makes this optimisation possible.

[4]Extended Response12 MarksPremium

20 Uses32 Views3 Likes

Login or Create an Account to view the mark scheme, comment, and add to a test