blob: 7983fe88b96966d8f5b8d5a803e590963b5fb42f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
case class Empty[a] extends IntMap[a];
case class Node[a](left: IntMap[a], keyVal: Pair[Int, a], right: IntMap[a]) extends IntMap[a];
abstract class IntMap[a] {
def lookup(key: Int): a = this match {
case Empty =>
error("clef inexistante")
case _ =>
};
};
|