Basic algorithms in programming