Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Alg1_Practicum;
- using Alg1_Practicum_Utils.Models;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Alg1_Practicum_Runnable
- {
- class Program
- {
- static void Main(string[] args)
- {
- NawDoublyLinkedList doubleLink = new NawDoublyLinkedList();
- NAW testNaw = new NAW("1", "2", "3");
- doubleLink.InsertHead(new NAW("1", "1", "3"));
- doubleLink.InsertHead(new NAW("1", "1", "1"));
- doubleLink.InsertHead(new NAW("1", "1", "1"));
- doubleLink.InsertHead(new NAW("2", "1", "1"));
- doubleLink.InsertHead(new NAW("5", "1", "2"));
- doubleLink.InsertHead(new NAW("1", "1", "2"));
- doubleLink.InsertHead(testNaw);
- Console.WriteLine("List before any operations");
- doubleLink.Show();
- doubleLink.SwapLinkWithNext(doubleLink.First.Next);
- Console.WriteLine("List after swapping first.next with the next");
- doubleLink.Show();
- doubleLink.BubbleSort();
- Console.WriteLine("List after sorting");
- doubleLink.Show();
- Console.WriteLine("");
- Console.WriteLine("");
- UndoableNawArray array = new UndoableNawArray(10);
- array.Add(testNaw);
- array.Add(new NAW("1", "1", "3"));
- array.Add(new NAW("1", "1", "1"));
- array.Add(new NAW("1", "1", "1"));
- array.Add(new NAW("2", "1", "1"));
- array.Add(new NAW("1", "1", "2"));
- array.Add(new NAW("1", "1", "2"));
- Console.WriteLine("Array before any operations");
- array.Show();
- array.Remove(testNaw);
- Console.WriteLine("Array after removing at index 2");
- array.Show();
- array.Undo();
- array.Undo();
- array.Undo();
- Console.WriteLine("Array after undo-ing three times");
- array.Show();
- array.Redo();
- Console.WriteLine("Array after redo-ing once");
- array.Show();
- System.Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement