Can someone help me figure which type of search this would be and how to implement it:
Write pseudocode for a binary search tree method that visits all nodes whose data lies within a given range of values beteewn 100 and 1,000
Consider the property of the BST
left_subtree < node < right_subtree
If the value in the node is in the range, its children may also be so you need to test both.
If the value lies outside of the range, you know that a whole subtree would also be outside, so you simply don't test it.
If the value don't fall in the range you just don't visit it.
Then you may ignore a whole subtree, because you know that all their values will lie outside the range.
I see so when we get 4 would never even go left because that is out of range. Totally understand. Thanks.
Also, what program did you make that tree on?