search algorithms in Python