DataStructuresCSharp/C#/Program.cs

62 lines
1.0 KiB
C#

using System;
using C_.Datastructures;
using C_.Datastructures.Nodes;
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
//LinkedList<int> list = new LinkedList<int>();
//list.Append(1);
//list.Append(2);
//list.Append(3);
//list.Append(4);
//list.Append(5);
//list.Append(6);
//list.Delete(5);
//list.Delete(2);
//list.Delete(0);
DoublyLinkedList<int> list = new DoublyLinkedList<int>();
list.Append(1);
list.Append(2);
list.Append(3);
list.Append(4);
list.Append(5);
list.Append(6);
list.Insert(6, 1);
Console.Write($"{list[0]} ");
Console.Write($"{list[1]} ");
Console.Write($"{list[2]} ");
Console.Write($"{list[3]} ");
Console.Write($"{list[4]} ");
Console.Write($"{list[5]} ");
Console.Write($"{list[6]} \n");
//DoublyLinkedList<int> list2 = new DoublyLinkedList<int>();
//list2.Append(1);
//list2.Append(2);
//list2.Append(3);
//list2.Append(4);
//list2.Append(5);
//list2.Append(6);
//list2.Append(7);
//list2.Append(8);
//var x = list[-6];
Console.ReadLine();