l = 13, h = 23
Output: 16 20
You don't need to read input or print anything. Your task is to complete the function printNearNodes() which takes the root Node of the BST and the range elements low and high as inputs and returns an array that contains the BST elements in the given range low to high (inclusive) in non-decreasing order.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(Height of the BST).
1 <= Number of nodes <= 104
1 <= l < h < 105