{"id":520,"date":"2011-11-09T20:20:54","date_gmt":"2011-11-09T20:20:54","guid":{"rendered":"http:\/\/psyphi.net\/blog\/?p=520"},"modified":"2011-11-09T20:20:54","modified_gmt":"2011-11-09T20:20:54","slug":"3-sorts-of-sort","status":"publish","type":"post","link":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/","title":{"rendered":"3 sorts of sort"},"content":{"rendered":"<p>I&#8217;ve been fiddling around recently with some stuff which I&#8217;m sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing examples of sort algorithms in Perl but they generally looked a bit unpleasant so like all programmers I decided to write my own (complete with errors, as an exercise to the reader). Here I&#8217;ve also added some notes, mostly to myself, which are largely unsubstantiated because I haven&#8217;t measured memory, speed or recursion depth, for example (though these are well-documented elsewhere).<\/p>\n<p>1. Bubble Sort<\/p>\n<pre><code>#!\/usr\/bin\/perl -w\r\nuse strict;\r\nuse warnings;\r\n\r\nmy $set    = [map { int rand() * 99 } (0..40)];\r\nprint \"in:  @{$set}\\n\";\r\n\r\nmy $sorted = bubblesort($set);\r\nprint \"out: @{$sorted}\\n\";\r\n\r\nsub bubblesort {\r\n  my ($in)     = @_;\r\n  my $out      = [@{$in}];\r\n  my $length   = scalar @{$in};\r\n  my $modified = 1;\r\n\r\n  while($modified) {\r\n    $modified = 0;\r\n    for my $i (0..$length-2) {\r\n      if($out-&gt;[$i] &gt; $out-&gt;[$i+1]) {\r\n\t($out-&gt;[$i], $out-&gt;[$i+1]) = ($out-&gt;[$i+1], $out-&gt;[$i]);\r\n\t$modified = 1;\r\n      }\r\n    }\r\n  }\r\n\r\n  return $out;\r\n}<\/code><\/pre>\n<p>\n Bubblesort iterates through each element of the list up to the last but one, comparing to the next element in the list. If it&#8217;s greater the values are swapped. The process repeats until no modifications are made to the list.\n<\/p>\n<p>\n Pros: doesn&#8217;t use much memory &#8211; values are swapped in situ; doesn&#8217;t perform deep recursion; is easy to read\n<\/p>\n<p>\n Cons: It&#8217;s pretty slow. The worst-case complexity is <i>O(n<sup>2<\/sup>)<\/i> passes (for each value in the list each value in the list is processed once).\n<\/p>\n<p>2. Merge Sort<\/p>\n<pre><code>#!\/usr\/bin\/perl\r\nuse strict;\r\nuse warnings;\r\n\r\nmy $set    = [map { int rand() * 99 } (0..40)];\r\nprint \"in:  @{$set}\\n\";\r\n\r\nmy $sorted = mergesort($set);\r\nprint \"out: @{$sorted}\\n\";\r\n\r\nsub mergesort {\r\n  my ($in) = @_;\r\n\r\n  my $length = scalar @{$in};\r\n  if($length &lt; = 1) {\r\n    return $in;\r\n  }\r\n\r\n  my $partition = $length \/ 2;\r\n  my $left      = [@{$in}[0..$partition-1]];\r\n  my $right     = [@{$in}[$partition..$length-1]];\r\n\r\n  return merge(mergesort($left), mergesort($right));\r\n}\r\n\r\nsub merge {\r\n  my ($left, $right) = @_;\r\n  my $merge = [];\r\n\r\n  while(scalar @{$left} || scalar @{$right}) {\r\n    if(scalar @{$left} &amp;&amp; scalar @{$right}) {\r\n      if($left-&gt;[0] &lt; $right-&gt;[0]) {\r\n\tpush @{$merge}, shift @{$left};\r\n      } else {\r\n\tpush @{$merge}, shift @{$right};\r\n      }\r\n    } elsif(scalar @{$left}) {\r\n      push @{$merge}, shift @{$left};\r\n    } elsif(scalar @{$right}) {\r\n      push @{$merge}, shift @{$right};\r\n    }\r\n  }\r\n  return $merge;\r\n}<\/code><\/pre>\n<p>\n Mergesort recurses through the list, in each iteration breaking the remaining list in half. Once broken down to individual elements, each pair of elements\/lists at each depth of recursion is reconstituted into a new ordered list and returned.\n<\/p>\n<p>\n Pros: generally quicker than bubblesort; <i>O(n log n)<\/i> complexity.\n<\/p>\n<p>\n Cons: quite difficult to read\n<\/p>\n<p>3. Quicksort<\/p>\n<pre><code>#!\/usr\/bin\/perl\r\nuse strict;\r\nuse warnings;\r\n\r\nmy $set    = [map { int rand() * 99 } (0..40)];\r\nprint \"in:  @{$set}\\n\";\r\n\r\nmy $sorted = quicksort($set);\r\nprint \"out: @{$sorted}\\n\";\r\n\r\nsub quicksort {\r\n  my ($in) = @_;\r\n\r\n  my $length = scalar @{$in};\r\n  if($length &lt; = 1) {\r\n    return $in;\r\n  }\r\n\r\n  my $pivot = splice @{$in}, $length \/ 2, 1;\r\n  my $left  = [];\r\n  my $right = [];\r\n\r\n  for my $v (@{$in}) {\r\n    if($v &lt; $pivot) {\r\n      push @{$left}, $v;\r\n    } else {\r\n      push @{$right}, $v;\r\n    }\r\n  }\r\n\r\n  return [@{quicksort($left)}, $pivot, @{quicksort($right)}];\r\n}<\/code><\/code><\/pre>\n<p>\n Quicksort is probably the best known of all the sort algorithms out there. It&#8217;s easier to read than Mergesort, though arguably still not as easy as Bubblesort, but it&#8217;s a common pattern and its speed makes up for anything lacking in readability. At each iteration a pivot is selected and removed from the list. The remaining list is scanned and for element lower than the pivot is put in a new &#8220;left&#8221; list and each greater element is put into a new &#8220;right&#8221; list. The returned result is a merged recursive quicksort of the left list, the pivot and the right list.\n<\/p>\n<p>\n In this example I&#8217;m picking the middle element of the list as the pivot. I&#8217;m sure there are entire branches of discrete mathematics dealing with how to choose the pivot based on the type of input data.\n<\/p>\n<p>\n Pros: (One of?) the fastest sort algorithm(s) around; Reasonably efficient memory usage and recursion depth. Average <i>O(n log n)<\/i> complexity again (worst is <i>O(n<sup>2<\/sup>)<\/i>).\n<\/p>\n<p>\n Perhaps it&#8217;s worth noting that in 25-odd years of programming computers I&#8217;ve only ever had to examine the inner workings of sort routines as part of my degree &#8211; never before, nor after, but it&#8217;s certainly brought back a few memories.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been fiddling around recently with some stuff which I&#8217;m sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing &hellip; <a href=\"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;3 sorts of sort&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[11],"tags":[13,21,1081],"class_list":["post-520","post","type-post","status-publish","format-standard","hentry","category-programming","tag-code","tag-perl","tag-programming"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"I&#039;ve been fiddling around recently with some stuff which I&#039;m sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Roger Pettett\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"psyphi.net blog - Another collection of braingunk and technolint\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"3 sorts of sort - psyphi.net blog\" \/>\n\t\t<meta property=\"og:description\" content=\"I&#039;ve been fiddling around recently with some stuff which I&#039;m sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2011-11-09T20:20:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2011-11-09T20:20:54+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"3 sorts of sort - psyphi.net blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I&#039;ve been fiddling around recently with some stuff which I&#039;m sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#blogposting\",\"name\":\"3 sorts of sort - psyphi.net blog\",\"headline\":\"3 sorts of sort\",\"author\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\"},\"datePublished\":\"2011-11-09T20:20:54+00:00\",\"dateModified\":\"2011-11-09T20:20:54+00:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#webpage\"},\"articleSection\":\"programming, code, perl, programming\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/psyphi.net\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"name\":\"programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"position\":2,\"name\":\"programming\",\"item\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#listItem\",\"name\":\"3 sorts of sort\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#listItem\",\"position\":3,\"name\":\"3 sorts of sort\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/category\\\/programming\\\/#listItem\",\"name\":\"programming\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\",\"name\":\"psyphi.net blog\",\"description\":\"Another collection of braingunk and technolint\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/\",\"name\":\"Roger Pettett\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f715f8335258578c567eb8c22335f1cee22c971c2aff8be27c4d8d934c436503?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Roger Pettett\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#webpage\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/\",\"name\":\"3 sorts of sort - psyphi.net blog\",\"description\":\"I've been fiddling around recently with some stuff which I'm sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/2011\\\/11\\\/3-sorts-of-sort\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/author\\\/rmp\\\/#author\"},\"datePublished\":\"2011-11-09T20:20:54+00:00\",\"dateModified\":\"2011-11-09T20:20:54+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/\",\"name\":\"psyphi.net blog\",\"description\":\"Another collection of braingunk and technolint\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/psyphi.net\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"3 sorts of sort - psyphi.net blog","description":"I've been fiddling around recently with some stuff which I'm sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing","canonical_url":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#blogposting","name":"3 sorts of sort - psyphi.net blog","headline":"3 sorts of sort","author":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"publisher":{"@id":"https:\/\/psyphi.net\/blog\/#organization"},"datePublished":"2011-11-09T20:20:54+00:00","dateModified":"2011-11-09T20:20:54+00:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#webpage"},"isPartOf":{"@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#webpage"},"articleSection":"programming, code, perl, programming"},{"@type":"BreadcrumbList","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog#listItem","position":1,"name":"Home","item":"https:\/\/psyphi.net\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","name":"programming"}},{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","position":2,"name":"programming","item":"https:\/\/psyphi.net\/blog\/category\/programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#listItem","name":"3 sorts of sort"},"previousItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#listItem","position":3,"name":"3 sorts of sort","previousItem":{"@type":"ListItem","@id":"https:\/\/psyphi.net\/blog\/category\/programming\/#listItem","name":"programming"}}]},{"@type":"Organization","@id":"https:\/\/psyphi.net\/blog\/#organization","name":"psyphi.net blog","description":"Another collection of braingunk and technolint","url":"https:\/\/psyphi.net\/blog\/"},{"@type":"Person","@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author","url":"https:\/\/psyphi.net\/blog\/author\/rmp\/","name":"Roger Pettett","image":{"@type":"ImageObject","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/f715f8335258578c567eb8c22335f1cee22c971c2aff8be27c4d8d934c436503?s=96&d=mm&r=g","width":96,"height":96,"caption":"Roger Pettett"}},{"@type":"WebPage","@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#webpage","url":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/","name":"3 sorts of sort - psyphi.net blog","description":"I've been fiddling around recently with some stuff which I'm sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/psyphi.net\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/#breadcrumblist"},"author":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"creator":{"@id":"https:\/\/psyphi.net\/blog\/author\/rmp\/#author"},"datePublished":"2011-11-09T20:20:54+00:00","dateModified":"2011-11-09T20:20:54+00:00"},{"@type":"WebSite","@id":"https:\/\/psyphi.net\/blog\/#website","url":"https:\/\/psyphi.net\/blog\/","name":"psyphi.net blog","description":"Another collection of braingunk and technolint","inLanguage":"en-US","publisher":{"@id":"https:\/\/psyphi.net\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"psyphi.net blog - Another collection of braingunk and technolint","og:type":"article","og:title":"3 sorts of sort - psyphi.net blog","og:description":"I've been fiddling around recently with some stuff which I'm sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing","og:url":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/","article:published_time":"2011-11-09T20:20:54+00:00","article:modified_time":"2011-11-09T20:20:54+00:00","twitter:card":"summary_large_image","twitter:title":"3 sorts of sort - psyphi.net blog","twitter:description":"I've been fiddling around recently with some stuff which I'm sure I covered in my CS degree 16 (Gah! Really?) years ago but have had to re-educate myself about. Namely a few different implementations of sort. I implemented three types in Perl with some reacquaintance of the mechanisms via Wikipedia. I found a few existing"},"aioseo_meta_data":{"post_id":"520","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-05-16 15:30:01","updated":"2025-08-15 17:29:43","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/psyphi.net\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/psyphi.net\/blog\/category\/programming\/\" title=\"programming\">programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t3 sorts of sort\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/psyphi.net\/blog"},{"label":"programming","link":"https:\/\/psyphi.net\/blog\/category\/programming\/"},{"label":"3 sorts of sort","link":"https:\/\/psyphi.net\/blog\/2011\/11\/3-sorts-of-sort\/"}],"_links":{"self":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/comments?post=520"}],"version-history":[{"count":7,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/520\/revisions"}],"predecessor-version":[{"id":528,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/posts\/520\/revisions\/528"}],"wp:attachment":[{"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/media?parent=520"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/categories?post=520"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/psyphi.net\/blog\/wp-json\/wp\/v2\/tags?post=520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}