samples of algorithms