Ok. Got it fixed! Thanks for pointing out the time name issue; I hadn't realized I did that. The problem was in my print statements. I was using %f or %lf think of printing it as a float, changing it...
Type: Posts; User: TiredStudent
Ok. Got it fixed! Thanks for pointing out the time name issue; I hadn't realized I did that. The problem was in my print statements. I was using %f or %lf think of printing it as a float, changing it...
Hi.
I am working on a project for a multi-threaded prime number generator. All is working good except for one piece. I need to get the time for my program to generate my prime list. It is...
It did work fine! My problem was in my driver. I was printing out the "found value" and its children. I had a check for NULL, but it was after those print statements, so it was trying to print...
Ok. It is definitely working now, as long as the number is present. Still working on the case of it not being there. Yay for progress!
It is not working. It is again only checking the left hand nodes. :-( If not in the left hand nodes it returns the last left hand node. *Sigh* What do you think? Is there an error in the way I...
IT WORKS!!!!!! Thank you! You are a lifesaver! Just have to tweak it a bit, still getting a seg fault for a value not in the tree. X-D
It is not a binary search tree. That is what has made it so frustrating. To find the value we essentially have to search the whole tree. Any example I find always assumes it is a BST. :-(
Any other...
Could you please give me a suggestion on how to fix it, or how the algorithm should be? I am at my wit's end with it. Just a suggestion, I am not asking you to fix the code for me. Thank you.
typedef struct node Node;
typedef Node* NodePtr;
typedef Node* Tree;
struct node
{
int value;
NodePtr Left;
NodePtr Right;
};
HI, I am supposed to use a pre order transversal to search for an inputted value. The function returns a pointer to the node it is found in. If it is not found it should return NULL (I think). My...