Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
Already signed up?
New to KöMaL?

Problem I. 107. (May 2005)

I. 107. Suppose that there is an array with m+n elements in the memory (m and n are positive integers). Your task is to interchange the first n elements of the array with the last m elements - without using up any more memory. (The usage of some auxiliary variables is, however, allowed.) Neither the ordering of the first n elements, nor that of the last m elements should change during the process.

The precise and detailed description of your algorithm is to be submitted (i107.txt, together with the spreadsheet computing typical values of the auxiliary variables (i107.xls).

(15 pont)

Deadline expired on June 15, 2005.


7 students sent a solution.
12 points:1 student.
10 points:3 students.
9 points:1 student.
8 points:1 student.
7 points:1 student.

Problems in Information Technology of KöMaL, May 2005