I have done this problem but what to do if I have to do time complexity ??
I know using BFS it can be done but how to print in zig zag form?
Level Order(Zig Zag)
Refer these 2 approaches.
I have done this problem but what to do if I have to do time complexity ??
I know using BFS it can be done but how to print in zig zag form?
Refer these 2 approaches.