+ 1

BinaryTree issue

I have an issue but idk why this code is showing "Segmetion default" https://code.sololearn.com/cCg5ye2v8edx/?ref=app

1st Mar 2023, 4:23 PM
Marco Cárdenas
Marco Cárdenas - avatar
1 Antwort
+ 4
You have an infinite recursion. Also, you are reassigning tree inside insert, but this cannot be reflected, since the change is only locally (you need node **tree as parameter). But the primary problem now is the infinite loop.
1st Mar 2023, 5:00 PM
Ani Jona ­čĽŐ
Ani Jona ­čĽŐ - avatar