Quick sort is a very fast sort algorithm, which it’s used “divide and conquer strategy” to sort the data. On the average and best case, it has O(n log n) time complexity, on worst case, it has O(n^2) time complexity. And it is unstable sorting.
Time complexity of Selection Sort Algorithm in best case , worst case and average are all O(n^2) and need O(1) extra space. Selection sort can be implemented in stable sort or not.
Binary search algorithm time complexity is O(log2(n)), and this algorithm requires that source array is sorted in order to work correct.
Algorithm is quite simple. It can be done either recursively or iteratively:
1.get the middle element;
2.if the middle element equals to the searched value, the algorithm stops;
3.otherwise, two cases are possible:
(1)searched value is less, than the middle element. In this case, go to the step 1 for the part of the array, before middle element.
(2)searched value is greater, than the middle element. In this case, go to the step 1 for the part of the array, after middle element.