Bro @usernamestring She is admin from here and she don't like someone ask Data Structures Questions Here You can Google your problem it's a batter idea
I am also Google my all questions
i asked c++ question!
Looks like a basic recursive function, does what it does 😏
Binary Tree related to DS
Pre-order related to Binary Tree
there is 2 recursive function inside a function my question is , who going to stack , and who call first?
dont reply my message plz
Okay Bro 🙂
It starts from llink, so goes depth first left, then starts slowly moving to the right of the tree.
1) I am a man, you are a fellow indian, come on, how do you not know this? :D 2) That is obviously C++ related. What you sent was a question paper on DSA, which could be solved in any language.
It's looks old emogy
anyways enough offtopic
I think she thinks she is fun!
the call to first preorder(p->llink) expression
you can see this in action here: https://pythontutor.com/cpp.html, remove the templates obviously replace T with int. if a debugger is too much
actually my question is, here we have Preorder(p llink) Preorder(p rlink) Imagine that this function calling 2 times { Preorder(p llink) Preorder(p rlink) } SO this cycle going 2 times, And p llink and P rlink calling 4 times in total, true? And the recursive function going to stack, Here first function going to stack or second(cause these 2 functions calling sequently)? I hope that u undrestand my question
it would be much easier to see this in a debugger, yes it'll first go through it two times. left one's first. then the call stackwill unwind and then you go through the right ones
i think it will help me thanks, preorder(p->llink); preorder(p->rlink); the preorder(p->rlink) is the under of preorder(p->llink) i think i aske my question better, so the preorder(p) calling preorder(p->llink) and preorder(p->link) calling preorder(p->link->link) , soooo, when the preorder(p->rlink) will call? cause preorder(p->link) is above that
this makes no sense to me :)
it's quite easy, just see it in action in that site or a debugger. You'll immediately get how it works
Обсуждают сегодня