Changes

Jump to navigation Jump to search
177 bytes added ,  01:46, 14 December 2016
no edit summary
Line 66: Line 66:  
----
 
----
   −
'''Binary Sort''' (aka half-interval search/logarithmic search) is a search algorithm that finds a target value within a sorted array by comparing the target to the middle element, if unequal, the half of integers where the target cannot lie is unlimited. This process is continued unless target is identified.  
+
'''Binary Sort''' (aka half-interval search/logarithmic search) is a search algorithm that finds a target value within a sorted array by comparing the target to the middle element, if unequal, the half of integers where the target cannot lie is unlimited. This process is continued unless target is identified. In other words, this function will look for an item in an array by dividing the list in half every time it searches.
    
EX:  1, 7, 27, 33, 45,  57 , 66, 77, 89, 99, 101, 129, 156, 234
 
EX:  1, 7, 27, 33, 45,  57 , 66, 77, 89, 99, 101, 129, 156, 234
Line 104: Line 104:  
</syntaxhighlight>
 
</syntaxhighlight>
    +
Python Binary Sort Example 2
 +
 +
<syntaxhighlight lang="cpp">
     
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu