From 2b91028671b00b2f4a70d30dcc90f2f6a7448780 Mon Sep 17 00:00:00 2001 From: Mateusz779 <73058906+Mateusz779@users.noreply.github.com> Date: Wed, 15 Dec 2021 19:32:26 +0100 Subject: [PATCH] Delete Program.cs --- Program.cs | 56 ------------------------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 Program.cs diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 32fc4af..0000000 --- a/Program.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace bubble_sort_cs -{ - class Program - { - static void Main(string[] args) - { - int[] tmp= { 2, 7, 2, 1, 3, 100, 3, 32, 342, 2, 44, 23 }; - int[] sorted = sort_func(tmp,tmp.Length,false); - for (int i = 0; i <= sorted.Length-1; i++) - { - Console.WriteLine(sorted[i]); - } - } - static int[] sort_func(int[] sort, int len,bool repeat) - { - len = len - 1; - bool t = true; - int j = 0; - while (t) - { - for (int i = 0; i <= len - 1; i++) - { - if (sort[i] > sort[i + 1]) - { - int tmp = sort[i]; - sort[i] = sort[i + 1]; - sort[i + 1] = tmp; - j = 0; - } - else if (sort[i] == sort[i + 1]&& !repeat) - { - List tmp = new List(sort); - tmp.RemoveAt(i); - sort = tmp.ToArray(); - //for (int a = i; a < len - 1; a++) - // sort[a] = sort[a + 1]; - len--; - j = 0; - } - - else - { - if (j == len) - t = false; - else - j++; - } - } - } - return sort; - } - } -}