sketch of algorithms