Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
szemet
· 9y ago · 0 comments
If the data structures can be split (as it seems), then the first step should be to get the head k element of both collections, so we only have to work with a maximum of 2k elements. Then the solution is not O(2 * log(N)) but O(2 * log(min(N,2k))).
Comments
[–]
jacksontale
9y ago
Good thought, and also if k < N / 2
[–]
jacksontale
9y ago
Edited the post and added your comment