Skip to content

Chen-Si-An/2D-Sort

Repository files navigation

2D-Sort

This project provides an algorithm to sort given 2D points according to specific pattern.

  1. Pattern 0 Image

Image

  1. Pattern 1 Image

Image

  1. Pattern 2 Image

Image

  1. Pattern 3 Image

Image

This algorithm can offer selection of custom comparator, which not necessarily satisfies stringent compare required by STL sort.

Moreover, this algorithm demonstrates a better performance compared to stable_sort() provided by STL through using OpenMP.

  • Environment: CPU 11th Gen Intel(R) i7-11700 (8 cores), Debug
Number of Points 2D Sort stable_sort from STL
1001 * 1001 0.351 sec 0.401 sec
2001 * 2001 1.442 sec 1.619 sec
5001 * 5001 8.171 sec 10.816 sec
10001 * 10001 33.803 sec 56.846 sec