Which sorting algorithm makes minimum number of memory writes? Last Updated : 30 Oct, 2015 Comments Improve Suggest changes Like Article Like Report 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. Among the sorting algorithms that we generally study in our data structure and algorithm courses, Selection Sort makes least number of writes (it makes O(n) swaps). But, Cycle Sort almost always makes less number of writes compared to Selection Sort. In Cycle Sort, each value is either written zero times, if it's 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. Sources: http://en.wikipedia.org/wiki/Cycle_sort http://en.wikipedia.org/wiki/Selection_sort Comment More infoAdvertise with us Next Article Which sorting algorithm makes minimum number of memory writes? kartik Follow Improve Article Tags : Sorting DSA Practice Tags : Sorting Similar Reads Minimum cost to convert a '1' to a given number Given a positive integer 'n'. Starting with 1 find the minimum cost required to convert it to n using the following operations : Multiply the number by 2 with costs aAdd 1 to the number with costs bSubtract 1 from the number with costs c.Examples: Input: n = 31, a = 2, b = 5, c = 3Output: 13Explanat 10 min read Minimum time to write characters using insert, delete and copy operation We need to write N same characters on a screen and each time we can insert a character, delete the last character and copy and paste all written characters i.e. after copy operation count of total written character will become twice. Now we are given time for insertion, deletion and copying. We need 8 min read Minimum numbers to be appended such that mean of Array is equal to 1 Given an array arr[ ] of size N, the task is find minimum number of operation required to make mean of Array arr[ ] equal to 1. In one operation, a non-negative number can be appended in the end of the array. Examples: Input: N = 3, arr = {1, 1, 1}Output: 0Explanation:As it can be seen that mean of 4 min read Minimum number that can be obtained by applying '+' and '*' operations on array elements Given an array arr[] consisting of N positive integers and a string S of length (N - 1), containing characters '+' and '*', the task is to find the smallest number that can be obtained after applying the arithmetic operations mentioned in the string S on the array elements in any order. Examples: In 11 min read Analysis of different sorting techniques In this article, we will discuss important properties of different sorting techniques including their complexity, stability and memory constraints. Before understanding this article, you should understand basics of different sorting techniques (See : Sorting Techniques). Time complexity Analysis - W 5 min read Like