public override StateAutomaton ToStart()
        {
            StepsCount = 0;
            var copyArray = (int[])array.Clone();

            dataModel = new DataModel(copyArray);
            automatonSiftDown = new AutomatonSiftDown(copyArray);

            return new StateHeapSortAutomaton(-1, -1, -1, -1, "", copyArray, dataModel.SortedPart);
        }
 public AutomatonHeapSort(int[] array)
 {
    automatonSiftDown = new AutomatonSiftDown(array);
    dataModel = new DataModel(array);
    this.array = (int[]) array.Clone();
 }
        public override StateAutomaton DoStepBackward()
        {
            var copyArray = (int[]) array.Clone();
            
            dataModel = new DataModel(copyArray);
            automatonSiftDown = new AutomatonSiftDown(copyArray);

            return base.DoStepBackward();
        }