static bool allIsTraversed(DiskSpace[] input)
 {
     foreach(DiskSpace disk in input){
         if(!disk.isTraversed)return false;
     }
     return true;
 }
 static DiskSpace[] toDiskArray(int[] input)
 {
     DiskSpace[] diskSpace = new DiskSpace[input.Length];
     for (int i = 0; i < input.Length; i++)
     {
         diskSpace[i] = new DiskSpace(input[i]);
     }
     return(diskSpace);
 }
 static DiskSpace[] SSTF(int start, DiskSpace[] input)
 {
     DiskSpace[] SSTFQueue = new DiskSpace[input.Length + 1];
     SSTFQueue[0] = new DiskSpace(start);
     for (int i = 0; i < input.Length; i++)
     {
         SSTFQueue[i + 1] = findShortest(SSTFQueue[i].diskAddress, input);
     }
     return SSTFQueue;
 }
 static DiskSpace[] SSTF(int start, DiskSpace[] input)
 {
     DiskSpace[] SSTFQueue = new DiskSpace[input.Length + 1];
     SSTFQueue[0] = new DiskSpace(start);
     for (int i = 0; i < input.Length; i++)
     {
         SSTFQueue[i + 1] = findShortest(SSTFQueue[i].diskAddress, input);
     }
     return(SSTFQueue);
 }
        static void plot(DiskSpace[] disk)
        {
            string address="[ ";
            string swinger="[ ";
            for (int i = 0; i < disk.Length; i++)
            {
                address += disk[i].diskAddress + " ";
                swinger += "-" + i + " ";
            }
            address += " ]";
            swinger += "]";
            MLApp.MLApp matlab = new MLApp.MLApp();

            matlab.Execute("plot("+address+","+swinger+")");
        }
 static DiskSpace findShortest(int current, DiskSpace[] input)
 {
     int i = 0, sr = 0;
     for (i = 0; i < input.Length; i++)
     {
         sr = i;
         if (!input[i].isTraversed) break;
     }
     for (; i < input.Length; i++)
     {
         if (Math.Abs(input[i].diskAddress - current) < Math.Abs(input[sr].diskAddress - current) & (!input[i].isTraversed)) sr = i;
     }
     input[sr].isTraversed = true;
     return input[sr];
 }
 static DiskSpace[] toDiskArray(int[] input)
 {
     DiskSpace[] diskSpace = new DiskSpace[input.Length];
     for (int i = 0; i < input.Length; i++)
     {
         diskSpace[i] = new DiskSpace(input[i]);
     }
     return diskSpace;
 }
 static void output(DiskSpace[] disks)
 {
     foreach(DiskSpace disk in disks)
         Console.WriteLine(disk.diskAddress);
 }