public string getBFDisplay(TreeNode node)
if (node == null)
StringBuilder sb = new StringBuilder();
Queue<TreeNode> queue = new Queue<TreeNode>(); TreeNode current = null; queue.Enqueue(node);
Close, # represents the end of the line. The give node is null, and all nodes that could descend through that node are not included in the list. This is in contrast with some other methods of storing a tree, such as with an array of TreeNodes with the children of node n at indices 2n+1 and 2n+2, with those indices being null if no node exists there.