tag:blogger.com,1999:blog-6314876008291942531.post6263160767144003748..comments2024-01-14T00:36:43.430-08:00Comments on Antonio Gulli's coding playground: BSTUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6314876008291942531.post-40289684979786748562010-05-21T13:07:52.862-07:002010-05-21T13:07:52.862-07:00The standard sorted array code is to start from bo...The standard sorted array code is to start from both ends and move two pointers in tandem based on whether their sum is greater than, or lesser than K.<br /><br />In the case of BST though, keeping the pointers to the nodes will mean storing the recursion stack as well. That's log(n) storage. Is that acceptable?<br /><br />Or is there a "pure" constant space solution that doesn't even take the recursion stack depth into account?Tejaswihttps://www.blogger.com/profile/12566170957042360561noreply@blogger.com