Honeywell Interview Question

Ques are from Trees and String,