some sorts and search algorithms implemented in scala