Question
Min and Max in a BST
You are given the root of a binary search tree (BST). Your task is to determine the minimum and maximum elements present in the tree.

Note: A Binary Search Tree is a Binary Tree where every node's left child has a lower value, and every node's right child has a higher value.
Input
User Task
Since this is a functional problem, you do not need to handle input or output. Your task is to complete the function find_min_max(), which takes the root node as the input parameter.

Custom Input
The first line of input contains an integer, N, representing the number of nodes in the tree.
The next line consists of space-separated integers denoting the level order traversal of the tree, where non-negative values represent node values, and -1 indicates a null node.
Note: Once a node is marked as -1, no further information about its children is provided.
Output
Return a list of two integers where the first element is the minimum value and the second element is the maximum value in the BST.
Example
Input
9
44 27 65 16 33 57 -1 -1 19 -1 -1 -1 -1 17 21
Output
16 65
Explanation
The following image depicts the given BST:

Online