I thought of a brute force approach but did not work. For each character, I tested two possibilities: 1. Being a leaf (the leftmost node) and the next character is the root of a subtree. 2. Be the root of a subtree.
After testing all possible sums! Wladimir Araujo Tavares *Federal University of CearĂ¡ * On Tue, Jun 21, 2011 at 10:55 AM, Tundebabzy <tundeba...@gmail.com> wrote: > Hi guys, > Can anyone help me solve this (I mean explain to me how to solve it): > > The following text is an in-order traversal of a binary tree with 1023 > nodes. What is the sum of the digits appearing in the leaves? > > bDq4i3eFNmjh2oMgjNsIFkRWsonRl=tz9kf8gOpED2gVQrfx49GjR9/ > QNqTEJkSzM30p4RfneDc7EmdusIYdxxZ8KKdND==YpLlmN/FkErS7uqVHYIyGEBIhIRX > +mbg6FjVGqfYjobX3F1lSmPpLXXxhux1lV=EzIgGct9pd=ogzAdJU4/ > yZOj9=njfvbSo11bcE/yUDHg/J=6DAtmWt+P/VDvE4GyYHlKVGUoksn > +Lzm6Y1VVF6qw=onnKZS=CQQUPeMlUGtMobJEeyIyGBMFj5kHml1waI97qgVt/ > yeKWSXxhJyK+As0M0UR2KL+U7klKMlWlxgbIJ2beN0gaMHbIClKrBuroo > > +L73CwnbFKRiyKOx8Ke=PPukm1BWYd4Do5nikrT0dgPWlmItCzyZrEiOBgBtEB9FG1qdQJud182qYU4Xwry=bR7R5PH=Npab7JQ7gY=MYHW24iw=m2+XayIachr=QVt4giclLluUEu3Dx/ > 5y7R0GlINqoJc9O6QwEP6a9PRsdt86nZYQUF/ > b729lzilkM1PB8mDPACTOGobXSJJQshRQCoJoC9TX6ERou/ > > tlMWNQTaaU0YmzIFh8t72lgOeIMu4W2S9V8Y5jO8T47ZPRGxeQDWRQlpx1tc3AC4+x2zJxZaYV6d4+rxxWgYnYC1ZwUvXNF2YLaRw7ldRXCz9/7xZ3mKBj4Ox51L3PqGXAIB > > +OI4pgkUc1X52tOPdRPgpsfi8wNpynfylwjITvNKq93iViQiyiEVGBgazbHQ7boh5tejStBE1SCk1fMe1=ycNoxJzhAH4x/ > YlQSUOz/2qkl+JxFBt8sqRYXZjZ6R=Gh87ZwS4B0Meo56/WF+40bf2mTgG05KQ/ > qR89NMyttHdwwnzvkZuXGrlt/yuStJaXJNkqQ5atDPWqLJy4Q9iylEdI3qmTe6Wmou/ > umQG7Q > > +aiOXorJde3Z4CzMyTYnCWvudFDZvgEZsuKRiSOurstnxFRlqVQ0LC7WRuS=qCsDcxoDT5dl9NHusV4kZ/ > > I came across this @ www.readyforzero.com/challenge (problem 2) > > Please help me, I'm already tearing my hair out and i'm already > getting bald. I'm stuck because I don't know how it is possible to > figure out a tree from just its in-order traversal > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.