Jan 27, 2021
If two arrays are sorted we can align their indices and find values for constant time so the complexity will be Log(N) where N is size of the shortest array.
The same for the disk. If we sort an array in the memory we can read values from the disk one by one and access to corresponding values in the memory by aligned indexes.