-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
50 lines (40 loc) · 1.29 KB
/
Program.cs
File metadata and controls
50 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TreeTestConsoleApplication
{
class Program
{
static void Main(string[] args)
{
BinaryTree<int> Test = new BinaryTree<int>(BinaryTree<int>.CompareFunction_Int);
// Строим дерево
Console.WriteLine();
Test.Add(5);
Test.Add(2);
Test.Add(1);
Test.Add(3);
Test.Add(3); // Для теста еще разок
Test.Add(4);
BinaryTree<int>.Insert(Test, 999);
Test.Add(6);
Test.Add(10);
Test.Add(7);
Test.Add(8);
Test.Add(9);
// Поиск значений
for (int Lp = 1; Lp < 12; Lp++)
Console.WriteLine("({0}) = {1}", Lp, Test.Find(Lp));
// Не находит значение по Insert - я не понял почему
Console.WriteLine("(999) = {0}", Test.Find(999));
Console.WriteLine();
foreach (int value in Test)
{
Console.WriteLine("Value: {0}", value);
}
Console.ReadLine();
}
}
}