Показать сообщение отдельно
Старый 17.01.2012, 04:38   #3
JACUK
Знающий
 
Регистрация: 09.10.2009
Сообщений: 340
Написано 37 полезных сообщений
(для 61 пользователей)
Ответ: В чем ошибка?

По памяти коечто и сам намудрил, как то так))Вопрос тогда поставлю так.
Вот код(очень бредово?) как сделать метод Add?
using System;

namespace 
ClassLibrary
{
    public class 
BinaryTree
    
{
        public 
BinaryTree Left;
        public 
BinaryTree Right;
        public 
BinaryTree Parent;
        public 
string value;
        public 
BinaryTree()
        {
            
Left null;
            
Right null;
            
Parent null;
            
value null;
        }
        public 
void Print(BinaryTree r)
        {
            if (
== null) return;
            Print(
r.Left);
            if (
r.value != null)
            {
                
Console.Write(" " r.value " ");
            }
            Print(
r.Right);
        }
        public 
void Print()
        {
            Print(
this);
        }
        public 
void Add(string s)
        {
            
BinaryTree t = new BinaryTree();
            
this t;
            
t.Parent this;
            
t.value s;
        }             
    }

__________________




(Offline)
 
Ответить с цитированием