Xoriant interview question

basics on cpp ,stack and tree