**Compilation/Execution Result:**

Given a binary tree of size **N**, your task is to complete the function **zigZagTraversal(), **that prints the nodes of binary tree in **ZigZag** manner.

For Example: For the below binary tree the zigzag order traversal will be1 3 2 7 6 5 4.

**Input:**

The function takes a single argument as input, the reference pointer to the **root **of the binary tree.

There will be **T** testcases and for each test case the function will be called separately.

**Output:**

For each test case print on a new line space separated all the nodes of the tree in ZigZag manner.

**Constraints:**

1<=T<=500

1<=N<=1000

**Example:**

**Input:**

1

10

1 2 L 1 3 R 2 4 L 2 5 R 3 6 L 3 7 R 4 8 L 5 9 R 6 10 L 7 11 R

**Output:**

1 3 2 4 5 6 7 11 10 9 8

Pulkit Gupta 2 | 130 |

Relentless | 124 |

Ibrahim Nash | 94 |

nancygarg258_pec | 90 |

darkswordsman | 90 |

Ibrahim Nash | 602 |

KartikAgarwal | 541 |

rs119574 | 371 |

surbhi_7 | 356 |

Little Noah | 335 |

akhayrutdinov | 4261 |

sanjay05 | 3633 |

Ibrahim Nash | 3162 |

Quandray | 3028 |

Michael Riegger | 2359 |