• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Algorithm questions. See if you can get these!

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
Olog(k)? what are you talking about, k is a constant, log(k) is the same as k in this case. But the answer isn't either, its Olog(n), you just take the top of the heap and percolate up
 
Originally posted by: BrownTown
Olog(k)? what are you talking about, k is a constant, log(k) is the same as k in this case. But the answer isn't either, its Olog(n), you just take the top of the heap and percolate up

Like I said:

Using proper algorithms for the heap/tree, this works out to O(log_2 k) time amortized for each element you process, and requires O(k) storage.

It is most definitely not O(log(n)) time; it is O(log(k) * n) to merge n elements from k sorted streams into a single sorted stream.
 
which position these question are for ?

have a first google interview call next week ( after sending my CV and setting up a time to talk)

any idea wht to expect ?
 
Back
Top