Better HN
topnewbestaskshowjobs
Log inSign up

throwaway307349

2 karma · joined Feb 15, 2020 (6y ago) · 2 submissions

Submissions

comment 6y ago · link · parent

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.

comment 6y ago · link · parent

The worst is when the spec seems purposely vague (which is a reasonable part of the challenge), but there’s no channel provided to ask clarifying questions. CockroachDB was like this.