For this Question: Given an N-size array of unique integers, your task is to print the array in a waveform, i. e a1 >= a2 <= a3 >= a4 <= a5.. . print the lexicographically smallest array possible.The first line of input contains a single integer N, next line contains N space-separated integers depicting the values of the array.

<b>Constraints:-</b>
1 &le; N &le; 10<sup>5</sup>
1 &le; Arr[i] &le; 10<sup>9</sup>Print the array in wave form as mentioned.Sample Input :-
5
2 1 3 5 4

Sample Output:-
2 1 4 3 5

Sample Input:-
3
1 2 3

Sample Output:-
2 1 3, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {
		BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(read.readLine());

		StringTokenizer st = new StringTokenizer(read.readLine());

		int[] arr = new int[N];

		for(int i=0; i<N; i++) {
			arr[i] = Integer.parseInt(st.nextToken());
		}

		Arrays.sort(arr);

		StringBuilder res = new StringBuilder();

		for(int i=0; i<N-1; i+=2) {
			int temp = arr[i];
			arr[i] = arr[i+1];
			arr[i+1] = temp;

			res.append(arr[i] + " ");
			res.append(arr[i+1] + " ");
		}

		if(N % 2 != 0) {
			res.append(arr[N-1]);
		}

		System.out.print(res);

	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?