ESc101 Laboratory Assignment Wednesday of Week of 25/10/04 Write a program which takes, as input, a file with n integers and outputs same file containing n-2^k +1 integers such that j-th integer in the output file is the maximum of the j th, j+1 st,..., j+2^k-1 st input integers, for all j. The integer k should be read from the user. DONOT USE ARRAYS. For example if the input is 10, 26, 11, 53, 18, 67, 32, 83, 37, 19 and k=2 then the output is 53, 53, 67, 67, 83, 83, 83. One efficient way is to perform the computation in k+1 steps. In the first step find the maximum of the 2 numbers, in the second step find the maximum of 4 numbers, and so on. To perform the j-th step open the input file with two input-stream objects. Set the reader pointer at the first position in the first case and at the 2^j th position in the second. Output the larger of the two and move both pointers. Example: Let input be 10, 26, 11, 53, 18, 67, 32, 83, 37, 19. j=0 step 1 Inputfile: 10, 26, 11, 53, 18, 67, 32, 83, 37, 19 | | Outputfile 26 step 2 Inputfile: 10, 26, 11, 53, 18, 67, 32, 83, 37, 19 | | Outputfile 26 26 ... so on. Now j=1 step 1 Inputfile: 26, 26, 53, 53, 67, 67, 83, 83, 37 | | Outputfile 53 step 2 Inputfile: 26, 26, 53, 53, 67, 67, 83, 83, 37 | | Outputfile 53 53 ... so on. Note: Use two files FileA.dat and FileB.dat. In the first step assume that input is available in FileA.dat. In that step use FileB.dat as the output file. In the second step reverse their role, so on. Finally after the last step if the result is written in FileB.dat, then copy it back to FileA.dat. Note that the above method should be other than "main". Then in the "main" method call this method.