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
|
|
|
|
|
2022-03-19 00:00:13 +00:00
|
|
|
|
|
|
|
|
|
//LinkedList<int> list = new LinkedList<int>();
|
2022-03-18 22:28:24 +00:00
|
|
|
|
|
|
|
|
|
//list.Append(1);
|
|
|
|
|
//list.Append(2);
|
|
|
|
|
//list.Append(3);
|
|
|
|
|
//list.Append(4);
|
|
|
|
|
//list.Append(5);
|
|
|
|
|
//list.Append(6);
|
2022-03-19 00:00:13 +00:00
|
|
|
|
|
|
|
|
|
//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);
|
2022-03-23 21:20:19 +00:00
|
|
|
|
list.Insert(6, 1);
|
2022-03-19 00:00:13 +00:00
|
|
|
|
|
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]} ");
|
2022-03-23 21:20:19 +00:00
|
|
|
|
Console.Write($"{list[5]} ");
|
|
|
|
|
Console.Write($"{list[6]} \n");
|
2022-03-22 22:14:45 +00:00
|
|
|
|
|
2022-03-18 22:28:24 +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-15 21:37:24 +00:00
|
|
|
|
|
2022-03-04 08:45:53 +00:00
|
|
|
|
|
|
|
|
|
|