queue and tree