2010-09-15 20:22:10 -05:00
|
|
|
tag tree {
|
2011-03-06 17:35:07 -06:00
|
|
|
nil;
|
2010-09-15 20:22:10 -05:00
|
|
|
node(@tree, @tree, int);
|
|
|
|
}
|
2010-06-23 23:03:09 -05:00
|
|
|
|
2011-03-06 17:35:07 -06:00
|
|
|
fn item_check(@tree t) -> int {
|
|
|
|
alt (*t) {
|
|
|
|
case (nil) {
|
2010-06-23 23:03:09 -05:00
|
|
|
ret 0;
|
|
|
|
}
|
2011-03-06 17:35:07 -06:00
|
|
|
case (node(?left, ?right, ?item)) {
|
2010-06-23 23:03:09 -05:00
|
|
|
ret item + item_check(left) - item_check(right);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|