//Will be added soon

@@ -1,21 +1,2486 @@
-//Will be added soon
+    /*%0A%0A     * Java Program to Implement Heap Sort%0A%0A     */%0A%0A     %0A%0A    import java.util.Scanner;%0A%0A     %0A%0A    /* Class HeapSort */%0A%0A    public class HeapSort %0A%0A    %7B    %0A%0A        private static int N;%0A%0A        /* Sort Function */%0A%0A        public static void sort(int arr%5B%5D)%0A%0A        %7B       %0A%0A            heapify(arr);        %0A%0A            for (int i = N; i %3E 0; i--)%0A%0A            %7B%0A%0A                swap(arr,0, i);%0A%0A                N = N-1;%0A%0A                maxheap(arr, 0);%0A%0A            %7D%0A%0A        %7D     %0A%0A        /* Function to build a heap */   %0A%0A        public static void heapify(int arr%5B%5D)%0A%0A        %7B%0A%0A            N = arr.length-1;%0A%0A            for (int i = N/2; i %3E= 0; i--)%0A%0A                maxheap(arr, i);        %0A%0A        %7D%0A%0A        /* Function to swap largest element in heap */        %0A%0A        public static void maxheap(int arr%5B%5D, int i)%0A%0A        %7B %0A%0A            int left = 2*i ;%0A%0A            int right = 2*i + 1;%0A%0A            int max = i;%0A%0A            if (left %3C= N && arr%5Bleft%5D %3E arr%5Bi%5D)%0A%0A                max = left;%0A%0A            if (right %3C= N && arr%5Bright%5D %3E arr%5Bmax%5D)        %0A%0A                max = right;%0A%0A     %0A%0A            if (max != i)%0A%0A            %7B%0A%0A                swap(arr, i, max);%0A%0A                maxheap(arr, max);%0A%0A            %7D%0A%0A        %7D    %0A%0A        /* Function to swap two numbers in an array */%0A%0A        public static void swap(int arr%5B%5D, int i, int j)%0A%0A        %7B%0A%0A            int tmp = arr%5Bi%5D;%0A%0A            arr%5Bi%5D = arr%5Bj%5D;%0A%0A            arr%5Bj%5D = tmp; %0A%0A        %7D    %0A%0A        /* Main method */%0A%0A        public static void main(String%5B%5D args) %0A%0A        %7B%0A%0A            Scanner scan = new Scanner( System.in );        %0A%0A            System.out.println(%22Heap Sort Test%5Cn%22);%0A%0A            int n, i;    %0A%0A            /* Accept number of elements */%0A%0A            System.out.println(%22Enter number of integer elements%22);%0A%0A            n = scan.nextInt();    %0A%0A            /* Make array of n elements */%0A%0A            int arr%5B%5D = new int%5B n %5D;%0A%0A            /* Accept elements */%0A%0A            System.out.println(%22%5CnEnter %22+ n +%22 integer elements%22);%0A%0A            for (i = 0; i %3C n; i++)%0A%0A                arr%5Bi%5D = scan.nextInt();%0A%0A            /* Call method sort */%0A%0A            sort(arr);%0A%0A            /* Print sorted Array */%0A%0A            System.out.println(%22%5CnElements after sorting %22);        %0A%0A            for (i = 0; i %3C n; i++)%0A%0A                System.out.print(arr%5Bi%5D+%22 %22);            %0A%0A            System.out.println();            %0A%0A        %7D    %0A%0A    %7D
 %0A

Update HeapSort.java