Skip to content

Instantly share code, notes, and snippets.

@DeepSky8
Last active February 25, 2016 19:47
Show Gist options
  • Save DeepSky8/147bcd0955ebe368685f to your computer and use it in GitHub Desktop.
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.
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