Warning: fopen(/tmp/SghXTngBZPli-jCRtnb.tmp): failed to open stream: Disk quota exceeded in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 139

Warning: unlink(/tmp/SghXTngBZPli-jCRtnb.tmp): No such file or directory in /home/executea/public_html/blog/wp-admin/includes/class-wp-filesystem-ftpext.php on line 142
Site Loader
Auckland, New Zealand
Bubble sorting an array using C# Algorithm Here is the code snippet
      private static int[] SortInt(int[] value)
        {
            int temp = 0;
            //Outer loop, to loop complete array
            for (int i = 0; i < value.Length; i++)
            {
                //Compare with its peer
                for (int j = 0; j < value.Length - 1; j++)
                {
                    //Check if the first is greater than second, if its then swap
                    if (value[j] > value[j + 1])
                    {
                        temp = value[j + 1];
                        value[j + 1] = value[j];
                        value[j] = temp;
                    }
                }
            }

            return value;
        }

Thanks, Karthik KK

Post Author: Karthik kk

Leave a Reply

Your email address will not be published. Required fields are marked *