Ejemplo n.º 1
0
        public void GetArrayRotation5And3()
        {
            var res         = CircularArrayRotation.ShiftRight(new[] { 3, 4, 5, }, 2).ToArray();
            var arrayFormat = String.Format("{0}-{1}", res[1], res[2]);

            Assert.AreEqual("5-3", arrayFormat);
        }
Ejemplo n.º 2
0
        public void Rotate2()
        {
            var res = CircularArrayRotation.ShiftRight(new[] { 1, 2, 3, 4, 5, 6 }, 2).ToArray();

            Assert.IsTrue(res.SequenceEqual(new[] { 5, 6, 1, 2, 3, 4 }));
        }