首页 | 官方网站   微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 78 毫秒
1.
从生活化的递归现象、数学化的递归公式、程序化的递归方法等三个层次,分析了递归问题的关键思维特征、数学递归模型和程序设计方法,并提出递归方法应用模式,最后应用该模式求解典型的递归问题。  相似文献   

2.
递归算法的非递归化实现   总被引:14,自引:0,他引:14  
由递归算法直接转换成相应的非递归算法能有效地提高程序的执行效率,本文列出了几类递归算法的非递归化实现方法,分别说明了这几类递归算法的特点及算法实例,并给出了相应的非递归算法。  相似文献   

3.
对递归程序的结构进行了较为深入的研究 ,提出了递归树的概念 ,给出了递归程序的一般结构 ,把递归分为简单链结构、树状结构、复杂链结构三种情况 ,据此 ,给出了复杂的递归问题的程序设计方法 ,根据此方法 ,可方便地写出较为复杂的递归问题的递归程序 ,从而提高设计递归程序的效率。  相似文献   

4.
该文讨论了递归算法向非递归算法转变的主要几种方法,对一般数据结构教材中介绍的方法进行了总结和补充,帮助对递归难点的学习。  相似文献   

5.
使用非递归方式实现递归问题的算法程序,不仅可以节省存储空间,而且可以极大地提高算法程序的执行效率。本文给出了两种将递归问题的递归算法转换成非递归算法的有效方法,并以具体实例加以说明。  相似文献   

6.
提出一种把递归过程转换为非递归过程的方法——递归树法,画出递归过程的递归树,然后通过对递归树的后根序遍历实现递归过程的非递归化,最后通过案例说明该方法的可行性和有效性。  相似文献   

7.
虽然递归算法具有结构简练、清晰、可读性强等优点,但有时受执行效率和程序设计语言的限制,必须实现递归向非递归的转换.提出一个通用的算法框架实现一般递归算法向非递归算法的转换.该框架产生的非递归算法没有标号,适用于大多数程序设计语言.结合几个典型的实例说明该框架的应用方法和有效性.  相似文献   

8.
吴伟民 《现代计算机》1998,(9):24-25,28
本文讨论Java递归多线程方法,并用于实现可并行递归算法。  相似文献   

9.
递归方法无论在计算机科学还是在数学中都是一个重要的问题求解方法,许多复杂问题使用递归方法能以简单易懂的形式求出问题的解。但初学者较难掌握递归方法,递归程序的设计往往成了程序设计中的一个难点。本文通过与递推方法比较给出了递归的概念、递归与递推的区别、使用递归方法求解的思路及关键点、保证递归方法求解正确性的条件,最后指出了递归程序设计的思路。  相似文献   

10.
递归是设计程序的一种重要方法,文中对递归的定义及递归的基本条件进行了分析,给出了递归程序设计的基本方法,并结合数据结构中二叉树遍历和单链表结点输出的实例进行了验证,最后对递归程序进行了深度分析,说明了递归是一种有效的程序设计方法。  相似文献   

11.
How can a program written in pure applicative LISP be reused in a Fortran environment? One answer is by automatically transforming it from LISP into Fortran. In this paper we discuss a practical application of this technique-one that yields an efficient Fortran program. We view this process as an example of abstract programming, in which the LISP program constitutes an abstract specification for the Fortran version. The idea of strategy-a strategy for getting from LISP to Fortran-is basic to designing and applying the transformations. One strategic insight is that the task is easier if the LISP program is converted to ``recursive' Fortran, and then the recursive Fortran program is converted to nonrecursive standard Fortran. Another strategic insight is that much of the task can be accomplished by converting the program from one canonical form to another. Developing a strategy also involves making various implementation decisions. One advantage of program transformation methodology is that it exposes such decisions for examination and review. Another is that it enables optimizations to be detected and implemented easily. Once a strategy has been discovered, it can be implemented by means of rewrite-rule transformations using the TAMPR program transformation system. The transformational approach to program reuse based on this strategy has a measure of elegance. It is also practical-the resulting Fortran program is 25 percent faster than its compiled LISP counterpart, even without extensive optimization.  相似文献   

12.
程序Chopping对于程序理解、分析、调试、测试等具有重要的意义。已有的Chopping方法主要基于相互连接的系统依赖图(SDG),对于大程序这种SDG描述通常非常复杂,易导致程序Chopping结果不准确。针对这一问题,基于带标签的Java程序描述方法,提出一种Java程序Chopping方法。该方法利用这种描述附带的程序依赖信息,分析参数依赖关系,并在此基础上给出Chopping算法。此程序Chopping方法能把Java程序方法间的程序Chopping问题转换到Java程序方法内进行分析,程序依赖图具有结点少、可重用、可并发构造等优点。最后通过实例和实验给出程序Chopping方法的实施过程及有效性。  相似文献   

13.
基于程序图的McCabe结构复杂性度量   总被引:2,自引:1,他引:1  
程序复杂性度量是软件工程的一个研究领域 ,不同的软件设计方法可导致不同的程序复杂性。本文讨论了利用程序图进行 Mc Cabe结构复杂性度量的方法。  相似文献   

14.
Program Behavior     
Ferrari  D. 《Computer》1976,9(11):7-8
Among the performance characteristics of programs, the patterns of memory references they generate have the unique property of being totally irrelevant in a non-virtual memory context and perhaps the most important aspect of program behavior in a virtual memory system. It is because of their importance in the latter case that the referencing behavior is so often referred to as the "behavior" par excellence.  相似文献   

15.
An algebraic view of recursive definitions is presented, extending an already familiar analogy with homomorphisms. A notion of simulation of one recursive definition by another is then defined. This leads to a particular approach to verification and transformation, which places emphasis on the arrows between programs, rather than the programs themselves. These arrows are the program morphisms of the title. Examples are given, together with certain extensions of the idea. Also indicated is a methodology which can lead to the discovery of program morphisms and new equivalent versions of a given program.  相似文献   

16.
Program Slicing   总被引:1,自引:0,他引:1  
Program slicing is a method for automatically decomposing programs by analyzing their data flow and control flow. Starting from a subset of a program's behavior, slicing reduces that program to a minimal form which still produces that behavior. The reduced program, called a ``slice,' is an independent program guaranteed to represent faithfully the original program within the domain of the specified subset of behavior. Some properties of slices are presented. In particular, finding statement-minimal slices is in general unsolvable, but using data flow analysis is sufficient to find approximate slices. Potential applications include automatic slicing tools for debuggng and parallel processing of slices.  相似文献   

17.
程序理解   总被引:6,自引:0,他引:6  
程序理解是从计算机程序中获取有关信息的过程。作为程序维护中必不可少的环节,一直受到大家的关注。结合最近比较熟门的软件重建工程,分析程序理解中出现的一些问题以及解决方案。  相似文献   

18.
Sketching is a synthesis methodology that aims to bridge the gap between a programmer’s high-level insights about a problem and the computer’s ability to manage low-level details. In sketching, the programmer uses a partial program, a sketch, to describe the desired implementation strategy, and leaves the low-level details of the implementation to an automated synthesis procedure. In order to generate an implementation from the programmer provided sketch, the synthesizer uses counterexample-guided inductive synthesis (CEGIS). Inductive synthesis refers to the process of generating candidate implementations from concrete examples of correct or incorrect behavior. CEGIS combines a SAT-based inductive synthesizer with an automated validation procedure, a bounded model-checker, that checks whether the candidate implementation produced by inductive synthesis is indeed correct and to produce new counterexamples. The result is a synthesis procedure that is able to handle complex problems from a variety of domains including ciphers, scientific programs, and even concurrent data-structures.  相似文献   

19.
Program Testing     
Miller  E.F.  Jr. 《Computer》1978,11(4):10-12
Nearly everyone in the computer business is concerned about quality. It's probably fair to say there'll be a pot of gold or its currency equivalent awaiting the first person to figure out how to package up some "software quality" and provide it in large quantities at substantial OEM discounts!  相似文献   

20.
Advance Program     
《Computer》1978,11(7):77-84
  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号