For this Question: Given an array arr[] and a number K where K is not greater than the size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct.

<b>Note:</b> 
Do Not Use sort() STL function, Use heap data structure.The input line contains T, denoting the number of test cases. Each test case consists of two lines. The first line of each test case contains two integers N and K. Second-line contains N space-separated integer denoting elements of the array.

<b>Constraints:</b>
1 <= T <= 50
1 <= N <= 10000
1 <= K <= N
1 <= arr[i] <= 10<sup>6</sup>Corresponding to each test case, print the kth smallest element in a new line.Sample Input
1
6 3
7 10 4 3 20 15

Sample Output
7

<b>Explanation:</b>
Sorted array: 3 4 7 10 15 20, 7 is the third element, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {

	public static void sort(int arr[])
    {
        int n = arr.length;


        for (int i = n / 2 - 1; i >= 0; i--)
            heapify(arr, n, i);


        for (int i = n - 1; i > 0; i--) {

            int temp = arr[0];
            arr[0] = arr[i];
            arr[i] = temp;


            heapify(arr, i, 0);
        }
    }



    static void heapify(int arr[], int n, int i)
    {
        int largest = i;
        int l = 2 * i + 1;
        int r = 2 * i + 2;


        if (l < n && arr[l] > arr[largest])
            largest = l;


        if (r < n && arr[r] > arr[largest])
            largest = r;


        if (largest != i) {
            int swap = arr[i];
            arr[i] = arr[largest];
            arr[largest] = swap;


            heapify(arr, n, largest);
        }
    }
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- > 0) {
			int n = sc.nextInt();
			int k = sc.nextInt();
			int[] arr = new int[n];

			for(int i = 0; i < n; i++) {
				arr[i] = sc.nextInt();

			}
			sort(arr);
			System.out.println(arr[k-1]);
			arr=null;
        	System.gc();
		}

		sc.close();
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?