Snippets created by Konstantin Sh

  • Distance sort

    Sort collection of items based on criteria of closest distance between consecutive items. The resulting collection first element is one of two farthest items, the end element is the second of the farthest pair. For the collection of `n` items the distance function is called n*(n-1) /2 times. The distance for pair of items is assumed to not depend on items order.

    2 people like this

    Posted: 11 months ago by Konstantin Sh