Looking for someone to program a Binary Search Tree for me in C that allows for non-unique non-negative integer keys (going against a tradition BST, it can include the same number multiple times). It must include the following functionalities:
- Insert a given key, return key value, -1 if unsuccessful (run out of space).
- Delete a key (all nodes with the given key), return number of nodes deleted.
- Search for a key, return 1 if found, 0 otherwise.
- Min, Max: Return the minimum/maximum key in the tree.
- Successor/Predecessor: Given a key that exists in the tree, return the next bigger/smaller key in the tree. Return -1 if the given element is the biggest/smallest in the tree, or if the given key cannot be found in the tree.
Your program should be able to parse input provided in the standard input, each line of which performs one dictionary operation. Each line has one directive and potentially one key (dependent on the operation), separated by a single space character. You can assume that the input has no errors. The directives are:
INS: Insertion
DEL: Deletion
SEA: Search
MIN: Minimum
MAX: Maximum
PRE: Predecessor
SUC: Successor
HEI: Tree height
Example input file:
INS 45
INS 31
INS 45
DEL 10
SEA 31
SEA 11
DEL 45
MIN
SUC 80
INS 1
SUC 1
HEI
Which should produce the following output:
45
31
45
0
1
0
2
31
-1
1
31
1
I would like this done within 6 hours. This shouldn't take long if you know what you're doing. In your message to me, please type: "this won't take me long" or you will not be considered for the job.
"this won't take me long"
Hello, this will be extremely easy for me, reason being that I have already done something "very" similar, through the AVL binary search tree, available online at [login to view URL] Please just let me know and this will take 2 hours at most.
$30 USD en 0 día
5,0 (8 comentarios)
4,0
4,0
3 freelancers están ofertando un promedio de $73 USD por este trabajo
this won't take me long.....................................................................................................................................................................