Kata02: Karate Chop - CodeKata
Implement a binary search routine (using the specification below) in the language and technique of your choice. Tomorrow, implement it again, using a totally different technique. Do the same the next day, until you have five totally unique implementations of a binary chop. (For example, one solution might be the traditional iterative approach, one might be recursive, one might use a functional style passing array slices around, and so on).
http://tianlinliu-blog.logdown.com/posts/245330-http-codekata-com-kata-kata02-karate-chop
4. Deferred detection(iteration)
http://danieldyba.com/blog/2011/11/11/karate-chop-code-kata-second-run
Read full article from Kata02: Karate Chop - CodeKata
Implement a binary search routine (using the specification below) in the language and technique of your choice. Tomorrow, implement it again, using a totally different technique. Do the same the next day, until you have five totally unique implementations of a binary chop. (For example, one solution might be the traditional iterative approach, one might be recursive, one might use a functional style passing array slices around, and so on).
http://tianlinliu-blog.logdown.com/posts/245330-http-codekata-com-kata-kata02-karate-chop
4. Deferred detection(iteration)
- Advantage: if the keys are not unique, it returns the smallest index (the starting index) of the region where elements have the search key. The early termination version would return the first match it found, and that match might be anywhere in region of equal keys.
http://danieldyba.com/blog/2011/11/11/karate-chop-code-kata-second-run
Read full article from Kata02: Karate Chop - CodeKata