/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package DAA; /** * * @author dell */ import java.util.Scanner; import java.util.Random; import java.io.*; public class MergeSortDemo { static int size; public static void main(String[]args)throws IOException { Scanner in=new Scanner(System.in); System.out.println("enter the no.of elements to be started:(>5000):"); size=in.nextInt(); int inputArr[]=new int [size]; genRandomNumbers(inputArr); long startTime=System.nanoTime(); mergesort(inputArr,0,size-1); long estimatedTime=System.nanoTime()-startTime; PrintWriter outA=new PrintWriter(new File("msort.txt")); for(int i=0;i