-
-
Notifications
You must be signed in to change notification settings - Fork 357
/
Program.cs
32 lines (27 loc) · 863 Bytes
/
Program.cs
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
using System;
namespace TreeTraversal
{
class Program
{
static void Main(string[] args)
{
var tree = new Tree(2, 3);
Console.WriteLine("[#]\nRecursive DFS:");
tree.DFSRecursive();
Console.WriteLine();
Console.WriteLine("[#]\nRecursive Postorder DFS:");
tree.DFSRecursivePostorder();
Console.WriteLine();
Console.WriteLine("[#]\nStack-based DFS:");
tree.DFSStack();
Console.WriteLine();
Console.WriteLine("[#]\nQueue-based BFS:");
tree.BFSQueue();
Console.WriteLine();
tree = new Tree(3, 2);
Console.WriteLine("[#]\nRecursive Inorder DFS for Binary Tree:");
tree.DFSRecursiveInorderBinary();
Console.WriteLine();
}
}
}