how to traverse level order in n-ary tree or general tree?
Traverse in n-ary tree?
hello @kingshuk441,
it same as binary tree .
suppose u are currently at root node u.
push u into queue(q).
while q not empty()
. pop one element from the q print it.
. push all its child to the queue.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.