Insertion Sort for Singly Linked List – Searching and sorting – We have discussed Insertion Sort for arrays.In this article linked list is also discussed.
bubble sort in data structure
JAVA programming – Given a sorted array and a number x, find the pair in array whose sum is closest to x – Searching and sorting – Given a sorted array and a number x, find a pair in array whose sum is closest to x.
C++ programming – Given a sorted array and a number x, find the pair in array whose sum is closest to x – Searching and sorting – Given a sorted array and a number x, find a pair in array whose sum is closest to x.
C programming – Given a sorted array and a number x, find the pair in array whose sum is closest to x – Searching and sorting.- Given a sorted array. find a pair in array whose sum is closest to x.
Search in an almost sorted array – Searching and Sorting – A simple solution is linearly search given key in given array.Time complexity of solution is O(n).We cab modify binary search to do it in O(Logn) time.
QuickSort on Singly Linked List – Searching and sorting – Quick Sort on Doubly Linked List is discussed here.In Singly linked list was given as an exercise. Following is C++ implementation for same.
Sort a nearly sorted (K sorted) array – Searching and sorting – Given an array of n elements, where each element is at most k away from its target position.
Find the Minimum length Unsorted Subarray, sorting which makes the complete array sorted -Searching and sorting – Given an unsorted array arr[] of size n. find the minimum length subarray arr[s..e]
Which sorting algorithm makes minimum number of memory writes – Searching and Sorting – 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.
stability in sorting algorithms – Searching and Sorting – Some sorting algorithms are stable by nature like Insertion sort, Merge Sort, Bubble Sort, etc. And some sorting algorithms are not, like Heap Sort, Quick Sort.