{"id":25226,"date":"2017-10-15T15:50:32","date_gmt":"2017-10-15T10:20:32","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=25226"},"modified":"2017-10-15T15:50:32","modified_gmt":"2017-10-15T10:20:32","slug":"sorting-algorithm-makes-minimum-number-memory-writes","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/sorting-algorithm-makes-minimum-number-memory-writes\/","title":{"rendered":"Which sorting algorithm makes minimum number of memory writes?"},"content":{"rendered":"<p>Minimizing the number of writes is useful when making writes to some huge data set is very expensive, such as with <a title=\"EEPROM\" href=\"http:\/\/en.wikipedia.org\/wiki\/EEPROM\" target=\"_blank\" rel=\"noopener\">EEPROMs<\/a> or <a title=\"Flash memory\" href=\"http:\/\/en.wikipedia.org\/wiki\/Flash_memory\" target=\"_blank\" rel=\"noopener\">Flash memory<\/a>, where each write reduces the lifespan of the memory.<span id=\"more-10397\"><\/span><\/p>\n<p>Among the sorting algorithms that we generally study in our data structure and algorithm courses,\u00a0 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Selection_sort\" target=\"_blank\" rel=\"noopener\">Selection Sort<\/a> makes least number of writes (it makes O(n) swaps).\u00a0 But, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cycle_sort\" target=\"_blank\" rel=\"noopener\">Cycle Sort<\/a> almost always makes less number of writes compared to Selection Sort.\u00a0 In Cycle Sort, each value is either written zero times, if it\u2019s already in its correct position, or written one time to its correct position. This matches the minimal number of overwrites required for a completed in-place sort.<\/p>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>Which sorting algorithm makes minimum number of memory writes &#8211; Searching and Sorting &#8211; Minimizing the number of writes is useful when making writes to some huge data set is very expensive, such as with EEPROMs or Flash memory, where each write reduces the lifespan of the memory.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69969,71670],"tags":[71128,71222,71133,71893,72306,70030,72301,72302,70892,70461,71121,70978,71131,70531,70975,71130,71122,71151,72305,71146,70533,70536,71144,72311,72307,70895,70271,70928,71216,70017,71221,72235,71158,72300,70969,72308,70262,70914,70046,71714,71712,70272,71120,70016,72299,71695,70020,72304,71161,70534,70967,72303,72309,71142,72190,72310,72185,70532,72298],"class_list":["post-25226","post","type-post","status-publish","format-standard","hentry","category-algorithm","category-searching-and-sorting","tag-algorithm-for-bubble-sort","tag-algorithm-for-insertion-sort","tag-algorithm-of-bubble-sort","tag-algorithm-sort","tag-algorithm-visualization","tag-all-sorting-algorithms","tag-array-sort-java","tag-best-sorting","tag-best-sorting-algorithm","tag-bubble-sort","tag-bubble-sort-algorithm","tag-bubble-sort-c","tag-bubble-sort-code","tag-bubble-sort-complexity","tag-bubble-sort-example","tag-bubble-sort-in-data-structure","tag-bubble-sort-java","tag-bucket-sort-algorithm","tag-c-sort","tag-comparison-of-sorting-algorithms","tag-complexity-of-bubble-sort","tag-complexity-of-sorting-algorithms","tag-different-sorting-algorithms","tag-fastest-sort","tag-fastest-sort-algorithm","tag-fastest-sorting-algorithm","tag-heap-sort","tag-heap-sort-algorithm","tag-insertion-sort","tag-insertion-sort-algorithm","tag-insertion-sort-java","tag-java-algorithms","tag-java-sort","tag-java-sort-array","tag-java-sorting-algorithms","tag-list-of-sorting-algorithms","tag-merge-sort","tag-most-efficient-sorting-algorithm","tag-quicksort","tag-quicksort-algorithm-in-data-structure","tag-quicksort-algorithm-with-example","tag-search-algorithms","tag-selection-sort","tag-selection-sort-algorithm","tag-sort-c","tag-sorted","tag-sorting-algorithms","tag-sorting-algorithms-c-code","tag-sorting-algorithms-comparison","tag-sorting-algorithms-complexity","tag-sorting-algorithms-java","tag-sorting-algorithms-visualized","tag-sorting-animation","tag-sorting-in-data-structure","tag-sorting-methods","tag-sorting-visualization","tag-sortings","tag-time-complexity-of-sorting-algorithms","tag-which-sorting-algorithm-makes-minimum-number-of-memory-writes"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=25226"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/25226\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=25226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=25226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=25226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}