Skip to main content
10 events
when toggle format what by license comment
Jun 16, 2020 at 10:01 history edited CommunityBot
Commonmark migration
Aug 27, 2013 at 13:28 comment added Hameer Abbasi Marked as answer again for being closer to the exact algorithm. I didn't consider a self-balancing BST, or a Balance() function at all.
Aug 27, 2013 at 13:27 vote accept Hameer Abbasi
Aug 27, 2013 at 7:14 history edited Bernhard Barker CC BY-SA 3.0
added 72 characters in body
Aug 24, 2013 at 5:39 comment added Hameer Abbasi +1 I don't think any kind of sorting algorithm has been made better than O(n log n). You just reduced my problem to that. Kudos! Marked yours as the answer for being the simplest here.
Aug 24, 2013 at 5:37 vote accept Hameer Abbasi
Aug 25, 2013 at 3:13
Aug 13, 2013 at 12:27 comment added John R. Strohm That'll work. The key is that the current tree node defines one endpoint of a fully-closed interval, and either the left or right child defines the other endpoint of the interval. The closest value will be found somewhere in that interval. Actually, it will either be the current node, the child, or somewhere in subtree "between" the node and child. (I.e., in the subsequence between the node value and the child node value, in an inorder traverse.)
Aug 13, 2013 at 10:01 comment added COME FROM +1: Better than my answer.
Aug 13, 2013 at 9:05 history edited Bernhard Barker CC BY-SA 3.0
added 244 characters in body
Aug 13, 2013 at 8:52 history answered Bernhard Barker CC BY-SA 3.0