本研究將Introduction of Algorithms一書中的演算法分成三類:Loop、If-Else、Recursion,並從各類中挑選演算法來實作並進行評估。與其他工具相比,只有RecTCC對這三類演算法皆有支援。;There are several aspects to judge the quality of a source code. Students can learn how to write a better code from these evaluation features. Teachers can evaluate the source code besides the correctness of programs. In these evaluation features, the time complexity is an important feature. However, finding the time complexity of a source code is difficult.
In this paper, we implement a static time complexity analysis tool based on AST analysis, called RecTCC. Because of the lack of some information, present analysis tools based on AST analysis are not compatible with recursive functions. RecTCC uses the concept of Value Numbering and symbol tables to chase the function parameters. We take the variations between parameters and arguments as the workload variation of the recursive calls. RecTCC uses Big-O AST to find the time complexities comprised of the non-recursive call parts. Finally, RecTCC can find the time complexities of recursive functions by recurrence relations and the master theorem.
In this paper, we separate algorithms in "Introduction of Algorithms" into three categories: Loop, If-Else, Recursion. We implement some algorithms from these categories, and use them to test analysis tools. RecTCC is the only tool compatible with all algorithms in these three categories.