Qualcomm Interview Question

Traversing an M-ary tree recursively.