DataStructuresCSharp/C#/Program.cs

62 lines
1.0 KiB
C#
Raw Normal View History

2022-03-04 08:45:53 +00:00
using System;
using C_.Datastructures;
2022-03-04 16:58:31 +00:00
using C_.Datastructures.Nodes;
2022-03-04 08:45:53 +00:00
// See https://aka.ms/new-console-template for more information
2022-03-03 08:05:41 +00:00
Console.WriteLine("Hello, World!");
2022-03-04 08:45:53 +00:00
//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);
2022-03-22 22:14:45 +00:00
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");
2022-03-22 22:14:45 +00:00
//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();
2022-03-04 08:45:53 +00:00