I'm having trouble with the delete function for my binary tree. After thorough testing, I have discovered that the only time I have a crash is after deleting a leaf, and only after deletion when I try traversal again. Here is my functions:
It happens, not when deleting, but when I'm traversing again afterwards, no matter which traversal method(post, pre, inorder, both recursive and iterative). I'm assuming that after deletion, I am setting pointers wrong.
If you don't know what the debugger is, just say so.
Or rather, look up how to use it with your IDE.
A tip: there'll probably a menu called Debug, select "Start" or "Step into" from there.
When you figure out how to use your debugger, set breakpoints just after all possible problem lines, to isolate your problem. Run the program, and be prepared to hit something like "Continue".
I've been trying to debug, but as I said, the problem happens when I try traversal, not when the delete function is called, so when I debug, it breaks during traversal. I am no expert, or I wouldn't be asking for help. It's very difficult to track it that way, meaning that, yes, it is beyond me.