I have a problem that I need to complete:
We can represent a nonempty binary tree by list (root left_subtree right_subtree) and the empty tree by the empty list. Each binary search tree with integer labels can be considered representing a set of integers. Write a function which, given a set of integers S as a bst and an integer x, returns both the set of all the integers less than x and that of all the integers greater than x as bst’s. Use a pair rather than a list to represent the resulting sets.
I'm very new to Scheme. I've built trees using SML as well as prolog, but can't seem to get a hold of what I need to do for Scheme. Could anyone help me out and guide me towards this goal? Is my tree suppose to just look like this?
(list value left right)