0
binary tree
Hello I have a question that how can I implement binary tree on an array which I know size of it, I mean that the function prototype is : struct* binarytree(int Arr[],int sizeArr); what is the code?
3 Answers
+ 3
Hello, đ
--> what is the code!?
Please, Use the search feature before posting as to reduce the number of duplicate threads in Q/A section!đ
https://www.sololearn.com/post/10362/?ref=app
https://www.sololearn.com/learn/322/?ref=app
0
You can use this method :
The sons of each node (placed at index i in the array) is of index 2*i for the left son and 2*i + 1 for the right son
All you have left is to find a way to know when you reach a leave (do array of pointers ? A specific value forbidden elsewhere ?)
0
hello