4 ms·
Wasn't hard. The problems could be better explained, for example in the second one they should clarify that the binary tree is balanced and that each node is on
by drdo 15y ago
Wasn't hard. The problems could be better explained, for example in the second one they should clarify that the binary tree is balanced and that each node is one character.
- noglorp 15y ago> binary tree is balanced and that each node is one character I found that pretty intuitive given they tell us it is a tree with 2^n-1 nodes, and that this is then umber of characters in the text file. What I'm wondering about is what the '=' pad character means in the context of non-valid base64 (i.e. isn't it the same as the 'A' character - a null?)
- ithayer 15y agoyou're right - we should explain that it's balanced.
- drdo 15y agoOne quickly realises that you must mean a balanced tree, since otherwise there would be no unique solution, but it would still be nice if it was explicit in the text.
- noglorp 15y agoAny comment in regard to my question above? At present, question 2 has serious ambiguity as to how one should interpret the data. Clearly each character represents one node, but again, there is no clear procedure for converting values. Padding makes no sense in this context. Can you clarify?
- drdo 15y agoIt's just as ASCII, you should sum the leaves that have ASCII digits (sum their digit value, not their ASCII code) and ignore the non-digit leaves.
- zwieback 15y agoAh, that's the part I was missing. When I didn't see a digit in the first leaf I thought I had it wrong.
- noglorp 15y agoI still don't follow. Digit value rather than ASCII code... you mean Base64 digit value? If so, do you just ignore the pad char? (I mean... by "non-digit leaves" you are referring to the leaves represented by '=' and only those?) EDIT: I understand now... jeez that was a run-around! Ascii encoded decimal! Thanks for the clarifying replies all over.
- zwieback 15y agoI think it's literally one ASCII code (byte) per each of the 1023 nodes in the tree. Any time there's a non-digit in one of the leaf positions you ignore it.
- drdo 15y agoThere's no Base64, it's just regular ASCII, for each leaf that has an ASCII character '0' through '9', you sum 0 through 9 respectively.
- ithayer 15y agoThe characters should be interpreted as ASCII.
- leif 15y agoyeah I thought it was base64 and that was annoying