News for hackers. Stuff that matters.
Re:Is there an algorithm as beautiful as a poem? by _nalply on Sunday June 16, 2024 @09:23AM (#40696877)
For me, tree traversal is beautiful.

    traverse(node):
      if node:
        [ 
          ...traverse(node.left), 
          ...traverse(node.right), 
          node.value,
        ]
The pseudo-code recursively produces a list of the node values in post-order.

There are no comments on this comment yet.