Question: I need to write these two functions in haskell for searching a BST tree: successor :: Ord a => a -> Tree a -> Maybe
I need to write these two functions in haskell for searching a BST tree:
successor :: Ord a => a -> Tree a -> Maybe a
--Given a value (a) , search a tree to find the successor node (next highest value)
closest :: Int -> Tree Int -> Int
--Given an int, search a tree and find the node with the losest value to the given int (can be larger or smaller)
--Given
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
