https://123dok.net/document/8ydd4pey-a-complexity-calculus-for-recursive-tree-algorithms.html