different types of algorithms