Implementation: Data Structures
Binary Search Tree 1
Implement a balanced binary search tree.
Contains the description of operations on the tree, their number is not greater than
105. Each line contains one of the next operations:
- insert x - add the key x into the tree. If the key x is already in the tree, do nothing.
- delete x - delete the key x from the tree. If the tree does not contain the key x, do nothing.
- exists x - if the key x is in the tree, print "true", otherwise print "false".
All numbers are integers not greater than
109 by absolute value.
Print the result of all operations exists in format given in sample output.
insert 2 insert 5 insert 3 exists 2 exists 4 delete 5