r/programmingrequests • • Nov 29 '17

[REQUEST] How to implement a Binary tree with limited info (in C)?

I have this homework (due tomorrow) but I can't seem to find a way to do it.

I was given a preorder traversal (an array of strings with all the non-existing children represented as "NULL", so it's a full tree) and nothing else. the program part is not that difficult, but I have no idea how to implement it when the only info I have is a preorder traversal. A bit of code would be nice, but I think I could do it even if somebody explained the process (eli5 style).

Thank you in advance. (save meeeee pleeeaseee)

2 Upvotes

2 comments sorted by

1

u/SocialMemeWarrior Dec 06 '17

>6 days ago

>due tomorrow

Ouch

1

u/the_waterlemon Dec 06 '17

Wasn't all too important, but trying to get it to work sure did frustrate the hell out of me