Ejemplo n.º 1
0
        public void StackMinTest5()
        {
            var gfg = new StackMinQuestion();

            gfg.Push(10);
            Assert.AreEqual(10, gfg.GetMin());
            gfg.Pop();
            Assert.AreEqual(-1, gfg.GetMin());
        }
Ejemplo n.º 2
0
        public void StackMinTest1()
        {
            var gfg = new StackMinQuestion();

            gfg.Push(10);
            gfg.Push(5);
            gfg.Push(7);
            gfg.Push(9);
            gfg.Push(4);
            Assert.AreEqual(4, gfg.GetMin());

            gfg.Pop();
            Assert.AreEqual(5, gfg.GetMin());
        }
Ejemplo n.º 3
0
        public void StackMinTest2()
        {
            var gfg = new StackMinQuestion();

            gfg.Push(10);
            gfg.Push(9);
            gfg.Push(8);
            gfg.Push(7);
            gfg.Push(6);
            Assert.AreEqual(6, gfg.GetMin());

            gfg.Pop();
            Assert.AreEqual(7, gfg.GetMin());


            gfg.Pop();
            Assert.AreEqual(8, gfg.GetMin());


            gfg.Pop();
            Assert.AreEqual(9, gfg.GetMin());
        }
Ejemplo n.º 4
0
        public void StackMinTest4()
        {
            var gfg = new StackMinQuestion();

            Assert.AreEqual(-1, gfg.GetMin());
        }