Smalltalk is difficult, yeah it is, but that is not a way of saying you shouldn’t try it (or should you?), anyways, in some developing projects we were required to use Pharo and obviously Smalltalk; using Binary Search, we made a game that finds a number, this process is defined as the search of an element in an array by diving in sub-arrays in order to keep making the array smaller until we get to the desired element.

First we cut the element in half and we check if the desired value is the element in the middle and return it if this is true, if not we check another thing, if it is higher then we go to the right portion of the array, if not we go to the left side and so on until we get what we wanted.

Image result for binary search

I should say that some other languages are easier for this kind of problems, but surely this is something you want to know in order to start conceiving problems and analysis in other ways.

– RC

Deja un comentario

Diseña un sitio como este con WordPress.com
Comenzar