2022-03-04 08:45:53 +00:00
|
|
|
|
using System;
|
2022-05-04 20:01:09 +00:00
|
|
|
|
using C_.Datastructures.DoublyLinkedList;
|
2022-04-14 16:26:06 +00:00
|
|
|
|
using C_.Datastructures.BinaryTree;
|
2022-04-20 14:34:43 +00:00
|
|
|
|
using C_.Datastructures.Heap;
|
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);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-31 21:06:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-28 22:16:33 +00:00
|
|
|
|
// 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-05-04 20:01:09 +00:00
|
|
|
|
// list.Delete(0);
|
|
|
|
|
|
2022-03-28 22:16:33 +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-18 22:28:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-31 21:06:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Stack<int> stack = Stack<int>.Create();
|
|
|
|
|
|
|
|
|
|
//stack.Push(1);
|
|
|
|
|
//stack.Push(2);
|
|
|
|
|
//stack.Push(3);
|
|
|
|
|
//stack.Push(4);
|
|
|
|
|
//stack.Push(5);
|
|
|
|
|
//stack.Push(6);
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine(stack.Peek());
|
|
|
|
|
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Push(7);
|
|
|
|
|
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
//stack.Pop();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Queue<int> queue = Queue<int>.Create();
|
|
|
|
|
|
|
|
|
|
//queue.Push(1);
|
|
|
|
|
//queue.Push(2);
|
|
|
|
|
//queue.Push(3);
|
|
|
|
|
//queue.Push(4);
|
|
|
|
|
//queue.Push(5);
|
|
|
|
|
//queue.Push(6);
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine(queue.Peek());
|
|
|
|
|
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Push(7);
|
|
|
|
|
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
//queue.Pop();
|
|
|
|
|
|
2022-04-14 16:26:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
//Tree<int> tree = new Tree<int>();
|
2022-04-14 16:26:06 +00:00
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
//tree.Add(40);
|
|
|
|
|
//tree.Add(30);
|
|
|
|
|
//tree.Add(50);
|
|
|
|
|
//tree.Add(25);
|
|
|
|
|
//tree.Add(35);
|
|
|
|
|
//tree.Add(45);
|
|
|
|
|
//tree.Add(60);
|
|
|
|
|
//tree.Add(15);
|
|
|
|
|
//tree.Add(28);
|
|
|
|
|
//tree.Add(55);
|
|
|
|
|
//tree.Add(70);
|
2022-04-14 16:26:06 +00:00
|
|
|
|
|
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
////var x = tree.Delete(10);
|
|
|
|
|
////tree.Delete(5);
|
2022-04-05 21:35:33 +00:00
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
//var inorder = tree.Traverse(TraversalType.Inorder);
|
|
|
|
|
//var preorder = tree.Traverse(TraversalType.Preorder);
|
|
|
|
|
//var postorder = tree.Traverse(TraversalType.Postorder);
|
|
|
|
|
//var breadthFirst = tree.Traverse(TraversalType.Breadth);
|
2022-04-19 20:54:54 +00:00
|
|
|
|
|
|
|
|
|
|
2022-04-14 21:21:40 +00:00
|
|
|
|
|
2022-04-19 20:54:54 +00:00
|
|
|
|
|
2022-03-31 21:06:25 +00:00
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var x = HeapNode<int>.Create(1, null, new HeapNode<int> { Left = default, Right = default });
|
|
|
|
|
|
2022-03-18 22:28:24 +00:00
|
|
|
|
Console.ReadLine();
|
2022-03-15 21:37:24 +00:00
|
|
|
|
|
2022-03-04 08:45:53 +00:00
|
|
|
|
|
|
|
|
|
|
2022-04-20 14:34:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|