diff --git a/sorting/README.md b/sorting/README.md index 39c58bfe..9e4a7cc7 100644 --- a/sorting/README.md +++ b/sorting/README.md @@ -24,6 +24,7 @@ 1. [Bubble Sort](java/bubble-sort.java) 2. [Insertion Sort](java/insertion-sort.java) 3. [Selection Sort](java/selection-sort.java) +4. [Merge Sort](java/merge-sort.java) ### JavaScript diff --git a/sorting/java/merge-sort.java b/sorting/java/merge-sort.java new file mode 100644 index 00000000..4c6a34eb --- /dev/null +++ b/sorting/java/merge-sort.java @@ -0,0 +1,79 @@ +//Java program for implementation of Merge Sort +import java.util.*; + +class MergeSortApp +{ + private int[] arr; + public MergeSortApp() + { + arr = new int[]{12,54,222,54622,10,169,30}; //Array to sort + } + + //Funtion to display/Print Array + public void printArray() + { + for (int i=0;i