TRIOLOGY interview question

The question was based on trees and graphs.