algorithms with randomization 7404493