I’ve been trying to understand this algorithm to merge two sorted arrays with O(1) extra space:
It looks similar to shell sort by it doesn’t actually perform as many comparisons as shell sort. I haven’t found any page in the internet that explains this algorithm. Can anyone please explain why this algorithm works or point me to some resources that explains why it works. Thanks.