Teenagers are being radicalised to become cyber criminals, sex offenders and terrorists by the same algorithms in "toxic online spaces", the head of the National Crime Agency (NCA) has warned.