« first day (49 days earlier)      last day (203 days later) » 

1:31 PM
x.x
@StevenH. =( Lost me already
Could you give a few examples concerning t, N, tree[v], and tree.v?
Oh, nvm on t and N.
:| Don't really understand t and N
 
 
3 hours later…
4:49 PM
t(x,y) translates a number into a tree of 1s and 0s with y children for each node. It pads enough 0s so that the last row is all 0s and that the tree is full (all filled out ot the same level). t(0,x) = [0], which denotes a tree node tree with tree.v == 0 and no valid values for tree[i] because it's a leaf node.
t(1,3) returns a tree with tree.v == 1 and tree[0] == tree[1] == tree[2] == (leaf node with v==0)
t(2,3) returns the same exact tree as 1,3
t(3,3) returns a tree with three layers: the top node has value 1, its first child has value 1, and all the other nodes have value 0
I can get a diagram for that when I get home
All of these work off the binary representation: t(x,3) uses the binary representation of x
More in depth on t(3,3): we first represent 3 as its binary representation, 11_2. That has length 2, which can't possibly fill all 3 children. The lengths of flat representations of valid trees are sums of all powers of 3: 1, 1+3^1=4, 4+3^2=13, 13+3^3=40, etc
The first one that we could fill this to is two levels, which requires length 4, but that would put a 1 in the last level so we need to pad to 13 instead
so now we have 1100000000000_2
We split these up as 1 100 000 000 000
We add each group as children to the first breadth-first-search-wise node we haven't added children to yet. That means "100" is added as the root node's children, then 000 is added to the child 1, then 000 is added to the first child 0, and then 000 is added to the second child 0, and then there's no groups left to add
 

« first day (49 days earlier)      last day (203 days later) »