private static string GetKeysAsCommaSeparatedString(BinarySearchTreeNode <int, int> root) { var bfs = new StringBuilder(); root.BreadthFirstSearch(node => { if (bfs.Length > 0) { bfs.Append(","); } bfs.Append(node.Value.Key); return(false); }); return(bfs.ToString()); }