Example #1
0
            public InOut(string n, int duplicate) : base(Helfer.Assemble(n), duplicate, true)
            {
                inputStringConverter  = arg => Helfer.Arrayausgabe("Eingabe: ", arg, true);
                outputStringConverter = arg => "Duplikat: " + arg;

                AddSolver(Array_Solver_ConstantSpace);
            }
Example #2
0
 public InOut(string input, string output) : base(Helfer.Assemble(input), Helfer.Assemble(output))
 {
     copiedInputProvider   = Helfer.ArrayCopy <int>;
     inputStringConverter  = arr => Helfer.Arrayausgabe <int>("Eingabe: ", arr);
     outputStringConverter = arr => Helfer.Arrayausgabe <int>("Erwartet: ", arr);
     ergStringConverter    = arr => Helfer.Arrayausgabe <int>("Ausgabe: ", arr);
     CompareOutErg         = Helfer.ArrayVergleich <int>;
     AddSolver(MoveZeroes);
 }
Example #3
0
            public InOut(int i, string s) : base(i, Helfer.Assemble(s), true)
            {
                outputStringConverter = arg => Helfer.Arrayausgabe("Erwartet: ", arg);
                ergStringConverter    = arg => Helfer.Arrayausgabe("Ausgabe: ", arg);
                CompareOutErg         = Helfer.ArrayVergleich;

                AddSolver(Solve);
                AddSolver(Solve_NumSpaceComplexity);
            }
Example #4
0
 public Sort_Colors()
 {
     for (int i = 0; i < 10; i++)
     {
         int[] arr  = Helfer.Assemble(0, 2, Helfer.Rand.Next(16, 26));
         int[] copy = Helfer.ArrayCopy <int>(arr);
         Array.Sort(copy);
         testcases.Add(new InOut(arr, copy));
     }
 }
Example #5
0
 private static int[] Convert(string s)  //NOTE Input array is the Price difference of the Stocks each day Day 1: 9, Day 2: 11; Difference => 11-9 = 2;
 {
     int[] arr = Helfer.Assemble(s);
     for (int i = arr.Length - 1; i > 0; i--)
     {
         arr[i] = arr[i] - arr[i - 1];
     }
     arr[0] = 0;
     return(arr);
 }
 public InOut(string s, string s2, string s3) : base(new int[2][] { Helfer.Assemble(s), Helfer.Assemble(s2) }, Helfer.Assemble(s3))
 {
     copiedInputProvider   = arg => new int[2][] { Helfer.ArrayCopy(arg[0]), Helfer.ArrayCopy(arg[1]) };
     inputStringConverter  = arg => Helfer.Arrayausgabe("Eingabe:+\n", arg[0]) + "\n" + Helfer.Arrayausgabe(arg[1]);
     outputStringConverter = arg => Helfer.Arrayausgabe("Erwartet: ", arg);
     ergStringConverter    = arg => Helfer.Arrayausgabe("Ergebnis: ", arg);
     CompareOutErg         = Helfer.ArrayVergleich;
     AddSolver(MergeSmallerArrayIntoLarger_ConstantSpace);
     AddSolver(MergeSmallerArrayIntoLarger_ConstantSpace_StartFromBack);
     HasMaxDur = false;
 }
Example #7
0
 public InOut(string s, int i, int i2) : base(new Input(Helfer.Assemble(s), i), i2, true)
 {
     AddSolver(SimpleBinarySearch);
 }
Example #8
0
 public InOut(string arr, int i) : this(Helfer.Assemble(arr), i)
 {
 }
 public InOut(string s, string s2, int i) : base(Helfer.Assemble(s), new Output(Helfer.Assemble(s2), i), true)
 {
     inputStringConverter = arg => Helfer.Arrayausgabe("Eingabe: ", arg);
     AddSolver(FindContigousSubarray);
     HasMaxDur = false;
 }
 public InOut(string arr, int tar, string arr2) : this(Helfer.Assemble(arr), tar, Helfer.Assemble(arr2))
 {
 }
Example #11
0
 public Input(string arr, int el) : this(Helfer.Assemble(arr), el)
 {
 }
Example #12
0
 public Output(string arr, int len) : this(Helfer.Assemble(arr), len)
 {
 }
 public InOut(string s, string s2) : base(Helfer.Assemble(Helfer.removeChar(s, " .")), Helfer.Assemble(Helfer.removeChar(s2, " .")))
 {
     AddSolver((arg, erg) => erg.Setze(PlusOne(arg)), "Add One");
 }
Example #14
0
 public InOut(string s, string s2) : base(Helfer.Assemble(s), Helfer.Assemble(s2), true)
 {
     AddSolver(SolveConstSpace);
     AddSolver(SolveTwoPasses);
     AddSolver(SolveTwoPassesConstSpace);
 }