Rohit
BAN USERShouldn't Zoom 3 be this ?
aaaa aaab abba abbb baaa baab bbba bbbb
aaac aaad abbc abbd baac baad bbbc bbbd
acca accb adda addb bcca bccb bdda bddb
accc accd addc addd bccc bccd bddc bddd
caaa caab cbba cbbb daaa daab dbba dbbb
caac caad cbbc cbbd daac daad dbbc dbbd
ccca cccb cdda cddb dcca dccb ddda dddb
cccc cccd cddc cddd dccc dccd dddc dddd
Isn't it sufficient that we do this -
1. Perform normal binary search for N in the BST.
2. Every time we go down a right link of a node, remember the value of that node as 'best known maximum value smaller than N'.
3. While going down a right or a left link, it may be NULL. The two cases -
3a. If trying to go down the left link and link was found to be null, the current 'best known maximum value smaller than N' is the answer(in other words, the last node whose right link we took).
3b. If trying to go down the right link of a node and the link was found to be null then the node's value itself is the answer.
Repdorothylopez7485, Analyst at ABC TECH SUPPORT
My name is Dorothy and I am a Host. Nowadays I am doing a new experiment like spell to keep ...
We don't need two separate arrays do we ?
- Rohit March 12, 2011