|All-time Popular Problems|
|Sort a stack|
|Delete Middle of Linked List|
|BFS traversal of graph|
|Largest subarray of 0's and 1's|
|Immediate Smaller Element|
|Delete nodes having greater value on right|
|Node at a given index in linked list|
|Two numbers with sum closest to zero|
|Print all nodes that don’t have sibling|
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.
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.
For each test case output will be 1 if the node was correctly deleted else 0.
Example(To be used only for expected output):
1 2 3