top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Help C# Shell sort .Put in fuction that returns changed array.array int[] is called niz_brojeva

0 votes
16 views

#region shell_sort

          //element for one step of sort
          int elm = 3;

          for (int i = 0; i != niz_brojeva.Length; i++)
          {
              int j = i + elm;

              if (j >= niz_brojeva.Length)
              { j = Convert.ToInt32(niz_brojeva.Length - 1); }

              while (i != j)
              {

                  if (niz_brojeva[i] > niz_brojeva[j])
                  {
                      int temp;
                      temp = niz_brojeva[i];
                      niz_brojeva[i] = niz_brojeva[j];
                      niz_brojeva[j] = temp;          
                  } j--; }
                 }
     #endregion
posted May 6, 2017 by Leon Martinović

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button
{ j = Convert.ToInt32(niz_brojeva.Length-1); }
1 up-to-date

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...