Algorithms implementations and performance tests