Pergunta de entrevista da empresa Rivian

Develop an algorithm to reverse a binary tree.