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.
search algorithms
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.
Interpolation search vs Binary search – Searching and Sorting – On average the interpolation search makes about log(log(n)) comparisons(if the elements are uniformly distributed), where n is the number of elements to be searched.
TERNARY SEARCH – searching and sorting algorithm – The ternary search does less number of comparisons as it makes Log3n recursive calls, but binary search.
Binary Search – search and sorting – Search a sorted array by dividing the search interval in half. Begin with an interval covering the whole array.