Given a root of the tree you need to perform AVL tree deletion operations on it. You need to complete the method **delelteNode** which takes 2 arguments the first is the root of the tree and the second is the value of the node to be deleted.The function should return the root of the modified tree.

**Note:** Your code will be checked for each insertion and will produce an output 1 if all the nodes for a particular test case were correctly inserted else 0.

**Input:**

The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains 2 lines . The first line of each test case contains an integer N denoting the no of nodes to be inserted in the AVL tree and in the next line are N space separated values denoting the values of the nodes to be inserted to the tree. And last line denotes the element to be deleted.

**Output:**

For each test case output will be 1 if the node was correctly deleted else 0.

**Constraints:**

1<=T<=100

1<=N<=100

**Example(To be used only for expected output):
Input:**

2

2

1 2

1

3

1 2 3

2

1

1

Author: saksham seth

PrateekTiwari1 | 182 |

blackshadows | 154 |

TusharSharma3 | 151 |

dhananjaykajla | 134 |

udrasht | 124 |

Amit Kushwaha 1 | 551 |

TusharSharma3 | 496 |

mb1973 | 396 |

dhananjaykajla | 360 |

SaurabhPatil3 | 359 |

akhayrutdinov | 4973 |

Ibrahim Nash | 4712 |

Quandray | 4289 |

sanjay05 | 3668 |

GB11 | 2857 |

Login to report an issue on this page.