Exemplo n.º 1
0
        private void setButton_Click(object sender, RoutedEventArgs e)
        {
            if (SizeBox.Text == null || typeBox.SelectedIndex < 1)
            {
                return;
            }
            set    = true;
            size   = Convert.ToInt32(SizeBox.Text);
            length = (int)plane.ActualHeight / size;
            if (length == 0)
            {
                length++;
            }
            height = (int)plane.ActualHeight / length;
            init();
            visual = new Visualize(plane, arr, size, length, length);

            switch (typeBox.Text)
            {
            case "Selection Sort":
                sort = new Selection_Sort(visual, arr, size);
                break;

            case "Insertion Sort":
                sort = new Insertion_Sort(visual, arr, size);
                break;
            }
        }
Exemplo n.º 2
0
 public Insertion_Sort(Visualize visual, int[] arr, int size) : base(visual, arr, size)
 {
 }
Exemplo n.º 3
0
 public Selection_Sort(Visualize visual, int[] arr, int size) : base(visual, arr, size)
 {
 }
Exemplo n.º 4
0
 public Sorts(Visualize visual, int[] arr, int size)
 {
     this.visual = visual;
     this.size   = size;
     this.arr    = arr;
 }