Implementations of sortnig algorithms