Exemplo n.º 1
0
        static void Main(string[] args)
        {
            LR a = new LR("input.txt");

            a.ReadData();
            a.ProcessData();
            a.ShowResults();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            LR sir = new LR();

            sir.Read();
            sir.Right();
            sir.Left();
            sir.numereLR();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            Console.Write("Numarul de elemente din vector = ");
            int n      = int.Parse(Console.ReadLine());
            LR  vector = new LR();

            Console.WriteLine("Elementele vectorului (separate prin spatiu  ex: 1 2 3) :");
            vector.Formare(n);
            vector.isLR();
        }
Exemplo n.º 4
0
        static void Main()
        {
            LR prob = new LR("input.txt");

            prob.Read();
            prob.Right();
            prob.Left();
            prob.Print();

            Console.ReadKey();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            LR a = new LR("input.txt");

            // data = 6, 3, 1, 2, 6, 10,  7, 11, 16
            // L    = 6, 6, 6, 6, 6, 10, 10, 11, 16
            // R    = 1, 1, 1, 2, 6,  7,  7, 11, 16
            // varianta ineficienta de rezolvare.
            //int[] v = { 6, 3, 1, 2, 6, 10, 7, 11, 16 };
            //int contor = 0;
            //for (int i = 1; i < v.Length - 1; i++)
            //{
            //    bool ok = true;
            //    for (int j = 0; j < i; j++)
            //    {
            //        if (v[i] < v[j])
            //        {
            //            ok = false;
            //        }
            //    }

            //    for (int k = i + 1; k < v.Length - 1; k++)
            //    {
            //        if (v[i] > v[k])
            //        {
            //            ok = false;
            //        }
            //    }
            //    if (ok)
            //    {
            //        contor++;
            //    }
            //}
            a.ReadData();
            a.ProcessData();
            a.ShowResults();
        }