Grazie a herzmeister der Welten, io ora so che ci sono! L'ho provato e ha funzionato davvero!
namespace Tree
{
public partial class Form1 : Form
{
private SortedSet<int> binTree = new SortedSet<int>();
public Form1()
{
InitializeComponent();
}
private void Insert(int no)
{
binTree.Add(no);
}
private void Print()
{
foreach (int i in binTree)
{
Console.WriteLine("\t{0}", i);
}
}
private void btnAdd_Click(object sender, EventArgs e)
{
Insert(Int32.Parse(tbxValue.Text));
tbxValue.Text = "";
}
private void btnPrint_Click(object sender, EventArgs e)
{
Print();
}
}
}
fonte
2010-07-16 09:27:12
Possibile duplicato di [oggetti che rappresentano gli alberi] (http://stackoverflow.com/questions/1806511/objects-that-represent-trees) –
@RobertMacLean sei anni dopo, è una vittima? LOL! –
Sì e lo sapevi già sei anni fa: http://stackoverflow.com/a/3262982/53236: P –