Why my printallknode function is not printing all the nodes?
Hello @raj.verma5454,
-
It is required to print the nodes in increasing order.
So, rather printing it directly store it in a vector and then later sort the vector before printing it’s element.
Modification: line 40, 50, 72, 86, 125 -
Don’t forget to clean the vector before next test case.
Line 134 -
Missing case: when there is no node
line 118 -
Wrong function call.
Line 77, 91.
I have corrected your code:
Hope, this would help.
Give a like if you are satisfied.
Oh I was making a blunder. Calling wrong function. Thank you so much.