blob: 1662b9a105643e04584123597fcc7ac76f92ed58 (
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 =>
sys.error("clef inexistante")
case _ =>
};
};
|