Reputation: 1
I have these couple of questions:
My ideas: I thought a greedy on the given location would give us the right answer for 1) and 2) would be by basically just considering subtrees of depth = precision of the value. This would give us a standard BST but with subtrees to access floating point data points.
Let me know if these are correct.
Upvotes: 0
Views: 456
Reputation: 479
I don't think there is significant difference between BST for integer node and floating point node, and answer for 1) and 2) are straightforward. By BST in-order traversal, find the highest number below given float value until encounter a value that is greater than give value or traversal done.
Upvotes: 2