public Tuple <double, double> RunSearch(int arraySize, int nbArrays) { Init(arraySize, nbArrays); Stopwatch watch; double elapsedMsRedBlack = 0; double elapsedMsAVL = 0; for (int i = 0; i < nbArrays; i++) { int[] array = (int[])arrays[i].Clone(); RedBlackTree <int, string> rbTree = new RedBlackTree <int, string>(); foreach (var v in array) { rbTree.Add(v, DateTime.UtcNow.Millisecond.ToString()); } watch = Stopwatch.StartNew(); rbTree.GetMinKey(); watch.Stop(); double ticks = watch.ElapsedTicks; double microseconds = (ticks / Stopwatch.Frequency) * 1000000; elapsedMsRedBlack += microseconds; AVL AVLtree = new AVL(arrays[i]); watch = Stopwatch.StartNew(); AVLtree.Peek(); watch.Stop(); ticks = watch.ElapsedTicks; microseconds = (ticks / Stopwatch.Frequency) * 1000000; elapsedMsAVL += microseconds; } elapsedMsRedBlack /= nbArrays; elapsedMsAVL /= nbArrays; return(new Tuple <double, double>(elapsedMsRedBlack, elapsedMsAVL)); }