For a BST, I want to find the nodes' values in [a,b] form largerest value to smallest one. The simplest way I can think is as follows:
void printRange(BSTNode<Key,E>* root,int lowValue,int highValue) const
You are visiting all the nodes of the BST , irrespective of whether they lie in the range or not. And printing only the required values. A more refined algorithm would be :
Else just return from the function.
This way you do a filtered inorder traversal,visiting only the required part of your BST .