fydango
BAN USER
Comments (6)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
First, we know the starting number is 4
Then, we need to scan numbers between 4 and 16 (4^2) see if any of them is the asking next.
If there is a^b = n (4<m<16), then b <= logn.
for b in logn - o(n)
use binary search to pick a (<logn) so that a^b ==n - o(logn)
o(n* nlogn)
Comment hidden because of low score. Click to expand.
0
of 0 vote
Concur..
Strategy is to ignore how big the data is and deal with it in a controlled way.
Min or Max heap (depending on sorting order) with initial pull from the first (top) element in each stream.
Whenever the top of heap is extracted, pull another top from the same stream.
- some extra pointer here needed to associate the heap element back to the parent data stream.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
With column input, we can know row = len(array) / column
If devision is clean with no residue, then the row value is perfect.
Otherwise, there will be residue < column,
- fydango March 25, 2013