Advertisement
NanoBob

Stefan is very black

Sep 30th, 2016
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.24 KB | None | 0 0
  1. using Alg1_Practicum;
  2. using Alg1_Practicum_Utils.Models;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace Alg1_Practicum_Runnable
  10. {
  11.     class Program
  12.     {
  13.  
  14.        
  15.  
  16.  
  17.         static void Main(string[] args)
  18.         {
  19.             NawDoublyLinkedList doubleLink = new NawDoublyLinkedList();
  20.  
  21.             NAW testNaw = new NAW("1", "2", "3");
  22.             doubleLink.InsertHead(new NAW("1", "1", "3"));
  23.             doubleLink.InsertHead(new NAW("1", "1", "1"));
  24.             doubleLink.InsertHead(new NAW("1", "1", "1"));
  25.             doubleLink.InsertHead(new NAW("2", "1", "1"));
  26.             doubleLink.InsertHead(new NAW("5", "1", "2"));
  27.             doubleLink.InsertHead(new NAW("1", "1", "2"));
  28.             doubleLink.InsertHead(testNaw);
  29.  
  30.  
  31.             Console.WriteLine("List before any operations");
  32.             doubleLink.Show();
  33.  
  34.             doubleLink.SwapLinkWithNext(doubleLink.First.Next);
  35.             Console.WriteLine("List after swapping first.next with the next");
  36.             doubleLink.Show();
  37.  
  38.             doubleLink.BubbleSort();
  39.  
  40.             Console.WriteLine("List after sorting");
  41.             doubleLink.Show();
  42.  
  43.             Console.WriteLine("");
  44.             Console.WriteLine("");
  45.             UndoableNawArray array = new UndoableNawArray(10);
  46.             array.Add(testNaw);
  47.             array.Add(new NAW("1", "1", "3"));
  48.             array.Add(new NAW("1", "1", "1"));
  49.             array.Add(new NAW("1", "1", "1"));
  50.             array.Add(new NAW("2", "1", "1"));
  51.             array.Add(new NAW("1", "1", "2"));
  52.             array.Add(new NAW("1", "1", "2"));
  53.             Console.WriteLine("Array before any operations");
  54.             array.Show();
  55.             array.Remove(testNaw);
  56.  
  57.             Console.WriteLine("Array after removing at index 2");
  58.             array.Show();
  59.  
  60.             array.Undo();
  61.             array.Undo();
  62.             array.Undo();
  63.             Console.WriteLine("Array after undo-ing three times");
  64.             array.Show();
  65.  
  66.  
  67.             array.Redo();
  68.             Console.WriteLine("Array after redo-ing once");
  69.             array.Show();
  70.  
  71.  
  72.             System.Console.ReadKey();
  73.  
  74.         }
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement