||
||	for jwj, based on a Miranda past paper question
||

student == ([char], num)	|| name and age
btree * ::= Empty | Node (btree *) * (btree *)
impossibly_small_age = -100000000

oldest :: btree student -> [student]	|| by coincidence student will do here
	oldest Empty = []
	oldest (Node left top right)
		= find_students_of_age max_age (Node left top right)
			where
			max_age = find_max_age (Node left top right)


find_max_age :: btree student -> num
	find_max_age Empty                 = impossibly_small_age
	find_max_age (Node left (name,age) right)
		= max [find_max_age left, age, find_max_age right]


find_students_of_age :: num -> btree student -> [student]
	find_students_of_age age Empty = []
	find_students_of_age age (Node left (name,age') right)
		= find_students_of_age age left ++
		  [(name,age')] ++
		  find_students_of_age age right, 		if age' = age

		= find_students_of_age age left ++
		  find_students_of_age age right, 		if age' ~= age
