Sir,ma’am
i am trying this question(level order traversal) on gfg in which printlevel function should return vector array but my question is giving wrong output.so here i am sharing my 2 codes for your reference one which is a void function and other returning vector array.my first link output is correct but second is wrong.
Level order traversal
Hey Prabhleen! use similar concept as in first code(use a helper function) and instead of printing just push into a vector(which is of global scope or passed by reference).
Try to code it, if you still face problem then I’ll help
sir actually on gfg printlevel function should have return type of vector array.but in my code when i tried doing that my helper function was returning vector array but printlevel ko kaise vector return krvayen.mujhe smj ni aarha kaise return krenge isliye maine dono functions ko ek me hi mix krdiya pr vo wrong output de rha hai?
see to it!
ohh.
Thank you sir
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.