Skip to content

Instantly share code, notes, and snippets.

@metaxy
Created October 1, 2010 12:55
Show Gist options
  • Save metaxy/606171 to your computer and use it in GitHub Desktop.
Save metaxy/606171 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Blatt<T> : Blattbaum
{
T val { get; set; }
public Blatt()
{
}
public override bool isLeaf()
{
return true;
}
public override bool isNode()
{
return false;
}
}
class Node : Blattbaum
{
public Node()
{
}
public override bool isLeaf()
{
return true;
}
public override bool isNode()
{
return false;
}
public Blattbaum a{get; set;}
public Blattbaum b{get; set;}
public void show(Blattbaum a)
{
}
}
class Blattbaum
{
public virtual bool isLeaf()
{
return false;
}
public virtual bool isNode()
{
return false;
}
}
class Program
{
static void Main(string[] args)
{
Blatt<int> b = new Blatt<int>();
Blatt<int> c = new Blatt<int>();
Node n = new Node();
n.a = b;
n.b = c;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment