Last active
February 25, 2016 19:47
-
-
Save DeepSky8/147bcd0955ebe368685f to your computer and use it in GitHub Desktop.
BreadthTraverse gets stuck somewhere. When I use the debug feature, Visual Studio hits an error and closes after line 173.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace BinaryTree | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
} | |
} | |
public class Node<T> | |
{ | |
public T Value { get; set; } | |
public Node<T> Right { get; set; } | |
public Node<T> Left { get; set; } | |
public bool Printed { get; set; } | |
public int Count { get; set; } | |
} | |
public class BinaryTree<T> | |
{ | |
private Node<T> root { get; set; } | |
private Node<T> pointer { get; set; } | |
public void Add(T value) | |
{ | |
if (root == null) | |
{ | |
root.Value = value; | |
pointer = root; | |
} | |
else | |
{ | |
if (root.Value == value) | |
{ | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment