3 ms·
technical erratum: if each node in the list adds all the previous nodes as new objects, then with 4 nodes, the total number of objects is 10, not 24, and the o
by mattknox 16y ago
technical erratum: if each node in the list adds all the previous nodes as new objects, then with 4 nodes, the total number of objects is 10, not 24, and the overall order of the operation is O(n^2). It's still cool that he is faster, and cooler that it is using an AST, which seems to me like the right solution.
- tenderlove 16y agoOops! You're right. Should be O(n^2). I'll update. :-)