Exemplo n.º 1
0
        public static void DisplayQuest5()
        {
            CircuitLinkedList <Employee> list = new CircuitLinkedList <Employee>();

            list.InsertFromLast(new Employee(1, "A"));
            list.InsertFromLast(new Employee(2, "B"));
            list.InsertFromLast(new Employee(3, "C"));
            list.InsertFromLast(new Employee(4, "D"));

            Console.WriteLine(list.FindNextDuty("C", 7));
        }
Exemplo n.º 2
0
        public static string FindNextDuty(this CircuitLinkedList <Employee> list, string name, int days)
        {
            Employee target = list.FindFirstData(data => data.Name == name);

            if (target == default(Employee))
            {
                return(string.Empty);
            }

            Employee nextTarget = list.FindDataFromCurrentPosition(7);

            return(nextTarget.Name);
        }
Exemplo n.º 3
0
        public static void DisplayCircuitLinkedList()
        {
            CircuitLinkedList <int> list = new CircuitLinkedList <int>();

            list.InsertFromLast(3);
            list.InsertFromLast(4);
            list.InsertFromLast(5);
            list.InsertFromFront(1);
            list.InsertFromFront(2);

            Console.WriteLine(list);

            list.RemoveData(data => data % 2 == 0);

            Console.WriteLine(list);
        }
Exemplo n.º 4
0
 public CircuitListStack()
 {
     _list = new CircuitLinkedList <T>();
 }