Updated bounds search on Doubly Linked List and completed traverse method
This commit is contained in:
@ -5,22 +5,18 @@ using C_.Datastructures.Nodes;
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
Console.WriteLine("Hello, World!");
|
||||
|
||||
LinkedList<int> list = new();
|
||||
DoublyLinkedList<int> list = new DoublyLinkedList<int>();
|
||||
|
||||
list.Append(1);
|
||||
list.Append(2);
|
||||
list.Append(3);
|
||||
list.Add(1);
|
||||
list.Add(2);
|
||||
list.Add(3);
|
||||
list.Add(4);
|
||||
list.Add(5);
|
||||
list.Add(6);
|
||||
list.Add(7);
|
||||
list.Add(8);
|
||||
|
||||
LinkedList<int> list2 = new();
|
||||
var x = list[-6];
|
||||
|
||||
list2.Append(1);
|
||||
list2.Append(2);
|
||||
list2.Append(3);
|
||||
Console.WriteLine(x);
|
||||
|
||||
|
||||
LinkedList<int> list3 = LinkedList<int>.Create(list, list2);
|
||||
|
||||
list3.Insert(4, 1);
|
||||
list3.Delete(0);
|
||||
list3.Head = LinkedListNode<int>.Create(5, null);
|
||||
Console.ReadLine();
|
Reference in New Issue
Block a user