Talk:Batcher odd–even mergesort

GPUGems
"It is popularised by the first GPU Gems book" I don't find anything about sorting on GPU in GPUGems1. I think the author meant GPUGems2 instead. There is a chapter about exactly this topic. However, in meantime both books are available for free: GPUGems1, GPUGems2 --Coolcat42 (talk) 19:59, 4 January 2009 (UTC)

Missing Algorithm Explanation Section
The code example reveals all... to those that speak Python. We need a basic explanation in English Friendly Person (talk) 00:49, 5 May 2011 (UTC)

Not at all, running gives RuntimeError: maximum recursion depth exceeded — Preceding unsigned comment added by 94.208.248.165 (talk) 13:03, 30 June 2011 (UTC)

I corrected the code, tested with Kasterma (talk) 14:19, 30 June 2011 (UTC)

Algorithm only for power of two number of elements
I tried the code example and it does not work (IndexError: list index out of range), because the number of elements is not a power of two. The 2 is missing.

How could the algorithm work for lists of arbitrary length? CvJ1987 (talk) 12:48, 23 October 2011 (UTC)


 * You can pretend to sort a list that has the length of the next power of two. But remember the real size and in every compare_and_swap-function you must check if b >= realCount. In that case you simply don't swap the items. Popelmaus (talk) 08:42, 27 April 2012 (UTC)

Infobox: stated time complexity labelled space complexity
The infobox dubs a space complexity time complexity: this looks off. 94.220.51.28 (talk) 00:15, 28 March 2021 (UTC)