中大機構典藏-NCU Institutional Repository-提供博碩士論文、考古題、期刊論文、研究計畫等下載:Item 987654321/86501
English  |  正體中文  |  简体中文  |  Items with full text/Total items : 80990/80990 (100%)
Visitors : 42123086      Online Users : 1053
RC Version 7.0 © Powered By DSPACE, MIT. Enhanced by NTU Library IR team.
Scope Tips:
  • please add "double quotation mark" for query phrases to get precise results
  • please goto advance search for comprehansive author search
  • Adv. Search
    HomeLoginUploadHelpAboutAdminister Goto mobile version


    Please use this identifier to cite or link to this item: http://ir.lib.ncu.edu.tw/handle/987654321/86501


    Title: 教學用靜態時間複雜度分析工具;A Static Time Complexity Analysis Tool for Education
    Authors: 蔡家豪;Cai, Jia-Hao
    Contributors: 資訊工程學系
    Keywords: 時間複雜度;遞迴函式;靜態程式分析;抽象語法樹分析;Time complexity;Recursive function;Static program analysis;Abstract syntax tree analysis
    Date: 2021-07-20
    Issue Date: 2021-12-07 12:54:29 (UTC+8)
    Publisher: 國立中央大學
    Abstract: 程式碼的好壞可以從很多面向來分析。學習者可以從這些評分指標中,學習如何撰寫更好的程式碼。評分者也能藉由評分工具來對程式碼進行程式功能正確與否以外的評價。其中,時間複雜度是評價程式碼好壞與否的重要指標。但分析程式碼的時間複雜度並不是簡單的事。

    本研究實作一個基於抽象語法樹分析的程式碼時間複雜度靜態分析工具--RecTCC。現有的基於抽象語法樹分析的工具,因為能獲得的資訊不足,對於遞迴函式的支援性不佳。RecTCC利用Value Numbering的概念及符號表來追蹤函式參數,找出參數與引數之間的值的變化,並以此來當作遞迴呼叫的工作量變化。Big-O AST會在AST上記錄各節點的時間複雜度,走訪Big-O AST並計算循序、選擇、重覆結構的時間複雜度,可找出非遞迴呼叫部份的部份時間複雜度。由以上步驟可以得到遞迴關係式,再搭配Master Theorem來分析遞迴函式的時間複雜度。

    本研究將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.
    Appears in Collections:[Graduate Institute of Computer Science and Information Engineering] Electronic Thesis & Dissertation

    Files in This Item:

    File Description SizeFormat
    index.html0KbHTML63View/Open


    All items in NCUIR are protected by copyright, with all rights reserved.

    社群 sharing

    ::: Copyright National Central University. | 國立中央大學圖書館版權所有 | 收藏本站 | 設為首頁 | 最佳瀏覽畫面: 1024*768 | 建站日期:8-24-2009 :::
    DSpace Software Copyright © 2002-2004  MIT &  Hewlett-Packard  /   Enhanced by   NTU Library IR team Copyright ©   - 隱私權政策聲明