Reputation: 45
The key is an int value in a BST.
I've solved a question before that asked for the deepest node size; which wasn't too difficult. But I'm not sure how to return the depth to compare for the deepest node and at the same time retrieve the value of the key of that node. I mean how many return values do you have?
Upvotes: 0
Views: 154
Reputation: 3
As Notrius posted, having a POJO should be simple enough to solve the problem. Just for your knowledge, some languages do support the concept of tuples, triplets etc. Java in itself doesn't support this, but there are some simpler libraries to supplement this. For example, Introduction to Javatuples
Upvotes: 0