I wrote a deleteNode bst function but its giving me segmentation fault:
The algorithm is like this:
find value to be deleted;
if found and it is leaf delete it
else if found value is greater than root value in right subtree
else value in left subtree
if value in right subtree
traverse right nodes
if found right node and value to be deleted link previous value with value next of found value
else if value is less that right node while in right subtree
traverse left nodes
delete if found and link
Please, someone should help me with this assignment, thank you
You need to write a code, which will calculates results, depending on the values that user enters to the running software: i.e.
1) Y=1/A i.e Y – is result, A is a variable, and it is known, that the variable A has values from the interval: A_begin, A_end, and the step (A_step) which describes the step (speed) in which variables varies. Result should be printed out in „table“ that it has columns, and we can easy recognize, which column has values of Y, and which column has values of A, etc.
Let say; we have several examples: A_begining = 1, A_end = 4, A_step = 1, that the software should make calculations on several A values (Y=1/1, Y=1/2, Y=1/3, Y=1/4) and print out the values of A and result of Y, every time it will make calculations.
If we have A_begining = 1, A_end = -4, A_step = -1, your software should make all posible calculations with A values (1, 0, -1, -2, -3, -4) , and print result on spcreen. You need to make software that it will not HANG, and run correclty on any A values, that user will enter to it. All examples that you need to pay attention when caculations can be done, and when not, what condition of A_begin vs A_end and A_step should be analyzed where explain in 116 room.
The result in table could be provided such way (or like this)