Company: IBM
Difficulty: medium
Question 1 Problem Description Given a binary tree, write a function to determine whether it is a binary search tree (BST). A binary search tree is defined as a binary tree in which for every node, the left subtree contains only nodes with values less than the node's value, and the right subtree contains only nodes with values greater than the node's value. Additionally, right subtrees must also be binary. How would you implement a solution to check if the given tree is a BST? #include /* * Complete the 'is_valid_bst' function below. * * The function is expected to return a BOOLEAN. * The function accepts STRING_ARRAY root as parameter. */ bool is_valid_bst(int root_count, char** root) { } Constraints DO NOT USE RECURSION