Divide and Conquer
-
QuicksortAlgoDS/Algorithm 2020. 1. 16. 22:58
1. Overview Like Merge Sort, QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways. Always pick the first element as a pivot. Always pick the last element as the pivot (implemented below) Pick a random element as pivot. Pick the median as a ..
-
Binary SearchAlgoDS/Algorithm 2020. 1. 16. 22:57
1. Overview Search a sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half. Repeatedly check until the value is found or the interval is empty. 2. Description 2.1 Procedure Comp..
-
Merge SortAlgoDS/Algorithm 2019. 8. 31. 14:45
1. Overview Like QuickSort, Merge Sort is a Divide and Conquer algorithm. It divides input array into two halves, calls itself for the two halves and then merges the two sorted halves. The merge() function is used for merging two halves. The merge(arr, l, m, r) is a key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one. See the following..
-
Fork Join frameworkStaticPL/JAVA 2019. 8. 23. 12:58
1. Overview The fork/join framework was presented in Java 7. It provides tools to help speed up parallel processing by attempting to use all available processor cores – which is accomplished through a divide and conquer approach. In practice, this means that the framework first “forks”, recursively breaking the task into smaller independent subtasks until they are simple enough to be executed as..