Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s an easy question if you just do an inorder traversal and stop at the kth element, but of course that’s not optimal. To get log(n) efficiency you need to augment the tree with subtree counts.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: