collection of basic algorithms