Some Basic Algorithms