What is the sort algorithm with fewest number of operations? I need to implement it in HLSL as part of a pixel shader effect v2.0 for WPF, so it needs to have a really small number of operations, considering Pixel Shader’s limitations. I need to sort 9 values, specifically the current pixel and its neighbors.
Share
You either want to use Insertion sort or Radix sort. Here are some C++ implementations:
Radix Sort
You need to call
radix()four times, as it only works on one column.Insertion Sort