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.
best sorting algorithm
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.
Iterative Quick Sort – Searching and Sorting – Partition process is same in both recursive and iterative. The same techniques to choose optimal pivot can also be applied to iterative version.
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.
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.
When does the worst case of Quicksort occur? – Searching and sorting – Since these cases are very common use cases, the problem was easily solved by choosing either a random index for the pivot.
Cycle Sort – Searching and sorting – Cycle sort is an in-place sorting Algorithm,unstable sorting algorithm, a comparison sort that is theoretically optimal in terms of the total number of writes to the original array
Bubble Sort – searching and sorting algorithm – Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements .