Ex. 17, Pt. 1
Define a function
path : (n : int) * (bst : BinarySearchTree) -> [left|right] that returns a list, where each element is either left or right, that describes the path to the node in bst which contains n. If that node is the root node, return an empty list. Solution.Ex. 17, Pt. 2
Define a function
sort : (lon : [int]) -> [int] that returns a list like lon but with all elements sorted in increasing order. Solution.Ex. 17, Pt. 3
Define a function
sort : (predicate : int * int -> bool) * (lon : [int]) -> [int] that returns a list like lon but with all elements sorted according to the comparison predicate. Solution.
No comments:
Post a Comment