4 ms·
When implementing complex algorithm, this kind of code is usually easiest to understand. When you look at the code, you use the paper that describes the algori
by nabla9 10y ago
When implementing complex algorithm, this kind of code is usually easiest to understand.
When you look at the code, you use the paper that describes the algorithm as documentation. Using same short one letter variable names in the code and paper makes understanding much easier.
The thing I hate most is when the the paper uses 1-based numbering and the programming language uses 0-based numbering. We should settle for 0-based numbering when describing algorithms.
- eru 10y agoArithmetic coding often looks just as dense, because C is not a good vehicle to describe algorithms. Look at eg https://www.cs.ox.ac.uk/jeremy.gibbons/publications/arith.pdf https://www.cs.ox.ac.uk/jeremy.gibbons/publications/arith.pd... to see a cleaner alternative. (This is about describing algorithms in papers. Optimizing for performance after the big-O has been taken care of is a different matter.)
- catwell 10y agoOr use 1-based programming languages :) I have implemented several algorithms from papers in Lua and that played in my favor more than once.