-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (35 loc) · 1007 Bytes
/
Copy pathProgram.cs
File metadata and controls
48 lines (35 loc) · 1007 Bytes
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
using System;
using MoshDataStructures;
namespace dojo
{
internal class Program
{
private static void Main()
{
var tree = new Tree();
tree.Insert(7);
tree.Insert(4);
tree.Insert(9);
tree.Insert(1);
tree.Insert(6);
tree.Insert(8);
tree.Insert(10);
// tree.Insert(14);
// tree.Insert(12);
// tree.Insert(15);
Console.WriteLine("does the sum exist? " + tree.ExistPathLeadingToGivenSum(112));
var tree2 = new Tree();
tree2.Insert(7);
tree2.Insert(4);
tree2.Insert(9);
tree2.Insert(3);
tree2.Insert(6);
tree2.Insert(8);
tree2.Insert(10);
tree2.Insert(11);
tree2.Insert(12);
Console.WriteLine("the height is " + tree.Height());
Console.WriteLine(tree.CountLeaves());
}
}
}