4 ms·
Other ideas, assuming on modern intel (or similar cache size) architecture -- you can load multiple ints at a time and do a bitwise or on the bits higher your l
by diziet 10y ago
Other ideas, assuming on modern intel (or similar cache size) architecture -- you can load multiple ints at a time and do a bitwise or on the bits higher your largest number.
There's also spagetti sort equivalent https://en.wikipedia.org/wiki/Parallel_random-access_machine https://en.wikipedia.org/wiki/Parallel_random-access_machine
Also https://en.wikipedia.org/wiki/Grover%27s_algorithm https://en.wikipedia.org/wiki/Grover%27s_algorithm
Original of this: https://www.quora.com/What-is-the-fastest-algorithm-to-find-the-largest-number-in-an-unsorted-array/answer/Thomas-A-Limoncelli?srid=X3V5 https://www.quora.com/What-is-the-fastest-algorithm-to-find-...