Welcome to Day 47 of the DSA Coding Challenge:
Todays Goals:
Question 1:Convert Sorted Array to Binary Search Tree
You are given an array where the elements are strictly in increasing (ascending) order, convert it to a height-balanced binary search tree. A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node does not differ by more than 1.
Question 2:Validate BST
You are given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
Both the left and right subtrees must also be binary search trees.
All the best!