Well, trees are recursive. Sometimes the cost bugs me, so I implement the tree as a list of lists ( each level in tree is its own list) ... this brings costs down but the code looks nasty and lot more bookkeeping under the hood.
If anything, I've fallen in love with recursion all over again...it is so bloody natural
Well, trees are recursive. Sometimes the cost bugs me, so I implement the tree as a list of lists ( each level in tree is its own list) ... this brings costs down but the code looks nasty and lot more bookkeeping under the hood. If anything, I've fallen in love with recursion all over again...it is so bloody natural