Pergunta de entrevista da empresa SAP Ariba

Write an algorithm to display a tree of data in multiple sorting orders.