algorithm examples