Selection Sort(Java Implementation)

Selection sort is a simple sorting algorithm. It sorts an array by repeatedly finding the minimum element (considering ascending order)¬†from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array. 1) The subarray which is already sorted. 2) Remaining subarray which is unsorted. Initially, the sorted part is …

Selection Sort(Java Implementation)Read More »

Binary Search(Java Implementation)

Binary search works on sorted arrays. Binary search begins by comparing the middle element of the array with the target value. If the target value matches the middle element, its position in the array is returned. If the target value is less than the middle element, the search continues in the lower half of the …

Binary Search(Java Implementation)Read More »

Linear Search( Java Implementation)

Linear search is a very simple search algorithm. In this type of search, a sequential search is made over all items one by one. Every item is checked and if a match is found then that particular item is returned, otherwise the search continues till the end of the data collection. For example, consider an …

Linear Search( Java Implementation)Read More »

%d bloggers like this: