Saturday, October 22, 2011

Theme 3: Basic methods construction algorithms. Part 3

Analysis of algorithms
    After developing and drafting stage of the algorithm comes to analysis. The analysis algorithm - an examination of its correctness, ie, determining the accuracy of the applied mathematical model, the coordination of individual blocks, routines, consistency of all actions.
    For the analysis algorithm used a system of testing. The essence of it lies in the selection of such initial data, which result to be obtained after the application of selected mathematical models, it is known in advance. The following reconciliation of the results of the composite algorithm with the same initial data will allow to determine its correctness. When testing the algorithm sequentially, step by step work examined some of its units - branches, loops, subroutines, input and output data. That's when single-step algorithm can correct logical errors.
    For complex and cumbersome algorithms can be applied technique using "stub", that instead of checking the implementation of selected parts of the algorithm currently used value to be derived from their implementation. Later, after the analysis of the main parts of the algorithm can return to the missing parts and to verify their correctness.
    Clearly, the incremental performance for large algorithms is a difficult task. For complex algorithms of modern programming environments provide users a convenient and useful features for single-step program for a computer to keep track of all the necessary intermediate values.
    Successive refinement algorithm
    During the analysis algorithm may need to clarify some of its parts, replacement of some fragments of more rational mathematical tools, design of individual blocks of the algorithm in the form of auxiliary algorithms for the next possible use in its other units.
    For the implementation of some algorithms by one of the essential factors is the time of their execution. When implementing these algorithms on a computer while the algorithm can be tested for different initial data. If the execution is not satisfied, the developer of the algorithm tries to apply more efficient methods for solving the task. Sometimes they are difficult to implement, but more effective on the timing of their implementation.
   

No comments:

Post a Comment