コード例 #1
0
        public static void Unorder()
        {
            String filePath = @"C:\Users\Neelabh\Desktop\GitHub\dataStructure\DataStructures\DataStructures\TextFile1.txt";
            String text     = System.IO.File.ReadAllText(filePath);

            string [] str = text.Split(" ");

            MyLinkedList ll = new MyLinkedList();

            for (int i = 0; i < str.Length; i++)
            {
                ll.AddLast(str[i]);
            }
            ll.Display();

            Console.WriteLine("enter the string");
            string s = Console.ReadLine();

            bool b = ll.CheckLL(s);

            if (b == true)
            {
                Console.WriteLine("remove the element from the list");
                ll.DeleteLL(s);
            }
            else
            {
                Console.WriteLine("Adding the element at the last of the list");
                ll.AddLast(s);
            }
            ll.Display();
            // to change the .txt file
            ll.WriteFile();
        }