Beispiel #1
0
 public static string Get(TData data)
 {
     if (data == null)
     {
         return(typeof(TData).Name + Prefix);
     }
     else
     {
         return(data.ToString() + Prefix);
     }
 }
Beispiel #2
0
            public string DebugPrint(int Indent = 0)
            {
                string S, SIndent;

                SIndent = new string(' ', Indent * 11);

                S = "Node(Key=" + _Key.ToString() + "; Color=" + (_IsRed ? "red" : "black") + "; Count=" + _Count.ToString() + "; Data=" + _Data.ToString() + "\u000d\u000a";

                S += SIndent + "     Left =";
                if (_Left != null)
                {
                    S += _Left.DebugPrint(Indent + 1);
                }
                else
                {
                    S += "null";
                }

                S += "\u000d\u000a" + SIndent + "     Right=";
                if (_Right != null)
                {
                    S += _Right.DebugPrint(Indent + 1) + ")";
                }
                else
                {
                    S += "null)";
                }

                return(S);
            }