anilnuru
BAN USER
Comments (4)
Reputation 20
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
If the data in question is Numbers/Ints
We can do a Partial MSD-Radix Sort at the Bit Level which will put all numbers more than 15 digits into the same Bucket.
The way radix sort works is with a Simple XOR operation on a certain Predetermined bit(based on 15 length) so it will be extremely fast and it is O(n).
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.
Comparing(>=<) Numbers is more expensive(32 times more expensive?) than XORing a single bit per number.
- anilnuru January 07, 2016Since the the data is 10 million, the XOR solution could perform much better than Brute Force.
What do you think?