Domanda di colloquio di Zscaler

Given a singly linked list, convert it into a tree like structure.