Converting the Adjacency List to Nested Sets