Created
October 1, 2010 12:55
-
-
Save metaxy/606171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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