{"id":1190,"date":"2010-12-07T18:33:28","date_gmt":"2010-12-08T01:33:28","guid":{"rendered":"https:\/\/simpleprogrammer.com\/2010\/12\/07\/back-to-basics-sorting\/"},"modified":"2018-04-12T23:41:20","modified_gmt":"2018-04-13T03:41:20","slug":"back-to-basics-sorting","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/back-to-basics-sorting\/","title":{"rendered":"Back To Basics: Sorting"},"content":{"rendered":"<p>Why is sorting so hard?\\n\\nOne of the most common misunderstandings and frustrations I see from developers is around sorting.\\n\\nAlmost every developer has faced needing to sort a list of things in some manner in their development careers.\u00a0 Many developers end up fumbling through it, looking for an example from the web and then copying that example, not really knowing what they did or why it works.\\n\\nIf you fall into that category, or just want to know a little better how sort works, stay tuned, we are going to make it simple.\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; padding-left: 0; padding-right: 0; display: inline; padding-top: 0; border: 0;\" title=\"harry-potter-sorting-hat\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg\" alt=\"harry-potter-sorting-hat\" width=\"477\" height=\"310\" border=\"0\" \/><\/a>\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2>Sorting algorithms?<\/h2>\n<p>\\n\\nNope.\\n\\nGreat for computer science.\u00a0 You should have a basic idea of how they work, but unless you are writing some low level bit twiddling code on an integrated circuit, you don\u2019t need to know about them.\\n\\nLet\u2019s think of sorting algorithms as a black box.\u00a0 You don\u2019t need to know what the algorithm is or how it works, you just need to know that if you give the two things it requires it will sort your list for you.\\n\\n<strong>What two things do all sorting algorithms, regardless of implementation need?<\/strong>\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>A list of things to sort<\/li>\n<p>\\n    <\/p>\n<li>A method to call to tell if object A comes before or after object B, or whether they are the same.<\/li>\n<p>\\n<\/ol>\n<p>\\n\\nThat is all you need to know and give to a sorting algorithm implementation and it will do the rest.\\n\\nEvery modern programming language has at least one sorting algorithm and every single one of them has the exact two same inputs I mentioned above, a list to sort, and a comparison method.\\n\\nIt doesn\u2019t matter if you are using C#, Java, Ruby or some other language, they all implement a sorting algorithm and need those two things.\u00a0 And that is all they need from you.\\n\\nThe burden is off your shoulders.\\n\\n<\/p>\n<h2>Step 1: Find the sorting method<\/h2>\n<p>\\n\\nI\u2019m going to do better than teach you how to sort in each language.\u00a0 I\u2019m going to show you how to figure out how to sort in a language.\\n\\nThe first step in doing that regardless of the language, is to find the method that sorts things.\\n\\nA good place to look is the list or collection object itself, since that is the most obvious place to put a sort routine.\\n\\nWhen we look up <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/6sh2ey19.aspx\">List<\/a> in C#, sure enough we find Sort on there.\\n\\nOh noes!\u00a0 So confusing!\u00a0 It has 3 sort methods!\u00a0 Which one do I call?\u00a0 Agh!\\n\\nDon\u2019t panic.\u00a0 Remember what I said above.\u00a0 Even though you see three signatures for the sort method, sort methods still only need two things.\\n\\n<em>Sort(), Sort(Comparison&lt;T&gt;), and Sort(IComparer&lt;T&gt;)<\/em> still need just a list and a method to compare two of your objects.\\n\\nWe\u2019ll dive into that more in a bit, now let\u2019s look at Java.\\n\\nIf we look up <em>ArrayList<\/em> in Java, we don\u2019t find a sort method.\u00a0 Boo.\u00a0 What were they thinking.\u00a0 It\u2019s ok though, googling for \u201cJava sort\u201d turns up <em>Arrays.sort<\/em> and <em>Collections.sort<\/em>.\\n\\nLet\u2019s look at <em>Collections.sort<\/em>.\\n\\nThis time we see two sort methods,<em> sort(List list),<\/em> and <em>sort(List list, Comparator c)<\/em>.\\n\\nAgain, nothing to be afraid of since we know the two things all sorting algorithms require from us.\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2>Step 2: Find the two things<\/h2>\n<p>\\n\\nSo if every sorting method needs the same two things from you, then all you need to do is figure out how to give it those two things.\\n\\nIn the C# and Java instances above, the first thing (the list of things to sort) is fairly obvious.\u00a0 In C# we saw that the sort method was on the list class itself, so we don\u2019t even need to pass it the list of things to sort, it still needs it, but it knows where to find it.\\n\\nIn the Java instance the first parameter to both sort methods is a list.\\n\\nSee how easy we just made things?\u00a0 We are already 50% there.\\n\\nSo really the only question left is how to provide the method that compares two of our objects.\\n\\n<strong>When we know what we are looking for, it is much easier to find and understand.<\/strong>\\n\\nLet\u2019s break down each instance and figure this out.\\n\\nIf we look at C#\u2019s <em>Sort()<\/em> method, without reading the documentation, we can probably guess two things.\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>The list to sort is the list we are calling the sort method on.<\/li>\n<p>\\n    <\/p>\n<li>The objects in the list provide the comparing method.<\/li>\n<p>\\n<\/ol>\n<p>\\n\\nThe first is obvious.\u00a0 The second one is a little less obvious, but if you think about it, since the method takes no parameters the only possible thing that could be providing the method for comparison is the objects in the list.\\n\\nIf we look at the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/b0zbh7b6.aspx\">documentation<\/a> for Sort(), we find that is true.\u00a0 The objects in the list have to implement <em>IComparable<\/em>.\u00a0 <em>IComparable<\/em> has one method, <em>CompareTo<\/em>, which takes one object and compares it to the other.\u00a0 If you implement this interface on your object, you can sort a list of them.\u00a0 Simple.\\n\\nFor <em>Sort(Comparison&lt;T&gt;)<\/em>, we can easily deduce that what is passed in there must be the method to compare two objects, and sure enough it is.\u00a0 If we want to use this method we just pass in a method of type <em>Comparison&lt;T&gt;<\/em> where T is the type of object we want to compare.\\n\\nWe can see that <em>Comparison&lt;T&gt;<\/em> is just a method that takes two of your objects and returns an int to indicate which is greater or if they are equal (1 = greater, 0 = equal, \u20131 less).\\n\\nThe final C# <em>Sort(IComparer&lt;T&gt;)<\/em> just takes an object that implements <em>IComparer&lt;T&gt;<\/em>.\u00a0 Sure enough, <em>IComparer&lt;T&gt;<\/em> has one method that must be implemented, Compare.\u00a0 That method has the same signature as <em>Comparison&lt;T&gt;<\/em> from above.\\n\\nNow, let\u2019s look at Java.\u00a0 You\u2019re going to find it is pretty much the same thing.\\n\\nFor <em>sort(List list)<\/em>, we can easily see that the list to sort is passed in as a parameter, but once again we have to find where we supply the method to compare two of our objects.\\n\\nSince it can\u2019t be passed in, it must be\u2026 say it with me\u2026 on the object.\u00a0 That is right!\\n\\nTurns out we just have to have our objects implement <em>Comparable<\/em> and then they can be sorted.\u00a0 When we look at the <em>Comparable<\/em> interface, we see that it just has one method, <em>CompareTo(Object o)<\/em> and that method just takes another object to compare our object to and returns 1 if ours is greater, 0 if it is the same, or \u20131 if ours is smaller.\\n\\nNow let\u2019s look at <em>sort(List list, Comparator c)<\/em>.\u00a0 In this case, we can see that the method to compare our two objects is passed in, but since we can\u2019t pass methods in Java, Comparator is just an interface that we can implement that provides the comparison method.\\n\\nIf we look at the <em>Comparator<\/em> interface, we see it has one method we need to implement <em>compare(Object o1, Object o2)<\/em>.\u00a0 I\u2019m sure you can guess what that method should return by now.\\n\\nSo regardless of the language, when you are looking at how to use a sorting algorithm, find the two things that it needs.\u00a0 The list is usually obvious, but the method to compare is almost always implemented in one of three ways.\\n\\n<\/p>\n<ol>\\n    <\/p>\n<li>An interface the objects being compared implement.<\/li>\n<p>\\n    <\/p>\n<li>A method that is passed in.<\/li>\n<p>\\n    <\/p>\n<li>An object that is passed in that implements a comparison interface.<\/li>\n<p>\\n<\/ol>\n<p>\\n\\n<\/p>\n<h3><\/h3>\n<p>\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2>Step 3: Implement the method<\/h2>\n<p>\\n\\nAfter you have figured out how to pass your list and your comparison method to the sorting algorithm, you need to actually write the comparison method.\\n\\nIf you learn to write a comparison method you can use it for any sorting algorithm, since all comparison methods do the exact same thing.\\n\\nFortunately, this is easy as well, because comparison methods always do the exact same thing.\u00a0 They take two objects and return whether the first one is larger, smaller, or equal to the second.\u00a0 That is it.\\n\\nDon\u2019t worry about sorting.\u00a0 Remember what I told you about the sorting algorithm black box?\u00a0 Let that sorting algorithm worry about sorting, all you have to do is decide whether 1 given item comes before a 2nd given item or if they are they same, nothing more.\\n\\nCan you do that?\\n\\nSort people on age?\\n\\nIf person1.Age &gt; person2.Age return 1\\n\\nElse if person1.Age &lt; person2.Age return \u20131\\n\\nElse return 0\\n\\nPsuedo-code, but pretty simple.\\n\\n<\/p>\n<h2>Wrapping it up<\/h2>\n<p>\\n\\nIf you can figure out what method you can use to sort in your language, find how to pass in the list of things to sort and provide the comparison method, and implement the comparison method, then you can sort!\\n\\n<strong>Just remember to not get overwhelmed and think logically about the two things that all sorting methods need from you, and you\u2019ll see how simple the whole sorting thing really is.\u00a0 <\/strong>\\n\\nYou can be the guy that everyone asks about sorting instead of the guy copying and pasting some sorting code from the internet that you aren\u2019t really sure how it works.\\n\\nBy the way, in C#, I would recommend just using the LINQ extension method OrderBy.\\n\\nVery nice to do something like:\\n\\npeople.OrderBy(p =&gt; p.Age).OrderBy(p =&gt; p.Name);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Why is sorting so hard?\\n\\nOne of the most common misunderstandings and frustrations I see from developers is around sorting.\\n\\nAlmost every developer has faced needing to sort a list of things in some manner in their development careers.\u00a0 Many developers end up fumbling through it, looking for an example from the web and then copying that&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3378,45348,1934,264],"tags":[],"class_list":["post-1190","post","type-post","status-publish","format-standard","hentry","category-algorithms","category-frameworks","category-language","category-learning"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Back To Basics: Sorting - Simple Programmer<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Back To Basics: Sorting - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"Why is sorting so hard?nnOne of the most common misunderstandings and frustrations I see from developers is around sorting.nnAlmost every developer has faced needing to sort a list of things in some manner in their development careers.\u00a0 Many developers end up fumbling through it, looking for an example from the web and then copying that...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2010-12-08T01:33:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-04-13T03:41:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/back-to-basics-sorting\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"Back To Basics: Sorting\",\"datePublished\":\"2010-12-08T01:33:28+00:00\",\"dateModified\":\"2018-04-13T03:41:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/back-to-basics-sorting\\\/\"},\"wordCount\":1681,\"commentCount\":2,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2010\\\/12\\\/harry-potter-sorting-hat_thumb.jpg\",\"articleSection\":[\"Algorithms\",\"Frameworks\",\"Language\",\"Learning\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/back-to-basics-sorting\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\",\"name\":\"Back To Basics: Sorting - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2010\\\/12\\\/harry-potter-sorting-hat_thumb.jpg\",\"datePublished\":\"2010-12-08T01:33:28+00:00\",\"dateModified\":\"2018-04-13T03:41:20+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2010\\\/12\\\/harry-potter-sorting-hat_thumb.jpg\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2010\\\/12\\\/harry-potter-sorting-hat_thumb.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Back To Basics: Sorting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Back To Basics: Sorting - Simple Programmer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/products\/careerguide","og_locale":"en_US","og_type":"article","og_title":"Back To Basics: Sorting - Simple Programmer","og_description":"Why is sorting so hard?nnOne of the most common misunderstandings and frustrations I see from developers is around sorting.nnAlmost every developer has faced needing to sort a list of things in some manner in their development careers.\u00a0 Many developers end up fumbling through it, looking for an example from the web and then copying that...","og_url":"https:\/\/simpleprogrammer.com\/products\/careerguide","og_site_name":"Simple Programmer","article_published_time":"2010-12-08T01:33:28+00:00","article_modified_time":"2018-04-13T03:41:20+00:00","og_image":[{"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg","type":"","width":"","height":""}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/back-to-basics-sorting\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"Back To Basics: Sorting","datePublished":"2010-12-08T01:33:28+00:00","dateModified":"2018-04-13T03:41:20+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/back-to-basics-sorting\/"},"wordCount":1681,"commentCount":2,"image":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg","articleSection":["Algorithms","Frameworks","Language","Learning"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/products\/careerguide#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/back-to-basics-sorting\/","url":"https:\/\/simpleprogrammer.com\/products\/careerguide","name":"Back To Basics: Sorting - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg","datePublished":"2010-12-08T01:33:28+00:00","dateModified":"2018-04-13T03:41:20+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/products\/careerguide"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2010\/12\/harry-potter-sorting-hat_thumb.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"Back To Basics: Sorting"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=1190"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1190\/revisions"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=1190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=1190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=1190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}