{"id":6986,"date":"2014-05-16T01:18:45","date_gmt":"2014-05-16T01:18:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/does-sorting-by-a-non-transitive-comparator-work-collection-of-common-programming-errors\/"},"modified":"2014-05-16T01:18:45","modified_gmt":"2014-05-16T01:18:45","slug":"does-sorting-by-a-non-transitive-comparator-work-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/16\/does-sorting-by-a-non-transitive-comparator-work-collection-of-common-programming-errors\/","title":{"rendered":"Does sorting by a non transitive comparator &ldquo;work&rdquo;?-Collection of common programming errors"},"content":{"rendered":"<p>The Collections.sort() is based on a mergesort.<\/p>\n<p>a mergesort has a O(logn) iterations overall, because the array size is ALWAYS divided, so the sort() should end, regardless the Comparator is not not transitive, so infinite loop won&#8217;t occur.<\/p>\n<p>Though, there are no guarantees on the resulted List&#8217;s order.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Collections.sort() is based on a mergesort. a mergesort has a O(logn) iterations overall, because the array size is ALWAYS divided, so the sort() should end, regardless the Comparator is not not transitive, so infinite loop won&#8217;t occur. Though, there are no guarantees on the resulted List&#8217;s order.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6986","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6986"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6986\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}