Level Order(Zig Zag)


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.