Java code, using recursion please. **NEW CODE ONLY** Write a method, printLinesInArray, that takes three parameters: a B
Posted: Fri May 20, 2022 1:34 pm
Java code, using recursion please. **NEW CODE ONLY**
Write a method, printLinesInArray, that takes three parameters:
a BufferedReader , a PrintWriter and a sorted array of distinct
integers. The method will write to the output (with the
PrintWriter) the lines of the input (read with the BufferedReader)
whose numbers are listed in the array. For instance if the array
contains the values {-10, 18, 24, 55, 133}, and the file read by
the BufferedReader has 100 lines line 1 line 2 … line 100 then the
PrintWriter should write to the output the lines 18, 24 and 55
since they all appear in the array. The values -10 and 133 are
ignored since they do not match any line number in the file. Your
solution should use recursion ONLY. No loops are allowed. Write
your solution in this file: .
Write a method, printLinesInArray, that takes three parameters:
a BufferedReader , a PrintWriter and a sorted array of distinct
integers. The method will write to the output (with the
PrintWriter) the lines of the input (read with the BufferedReader)
whose numbers are listed in the array. For instance if the array
contains the values {-10, 18, 24, 55, 133}, and the file read by
the BufferedReader has 100 lines line 1 line 2 … line 100 then the
PrintWriter should write to the output the lines 18, 24 and 55
since they all appear in the array. The values -10 and 133 are
ignored since they do not match any line number in the file. Your
solution should use recursion ONLY. No loops are allowed. Write
your solution in this file: .