new ada

Upload: gagandeep-mehta

Post on 21-Feb-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/24/2019 NEW ADA

    1/49

    Algorithm Design And Analysis

    ALGORITHM DESIGN AND ANALYSIS

    Algorithm design is a specific method to create a mathematical

    process in solving problems. Applied algorithm design is algorithmengineering. Algorithm design is identified and incorporated into

    many solution theories of operation research, such as dynamic

    programming and divide-and-conquer. Techniques for designing and

    implementing algorithm designs are algorithm design patterns,[1]such

    as template method pattern and decorator pattern, and uses of data

    structures, and name and sort lists. Some current day uses of

    algorithm design can be found in internet retrieval processes of ebcraling, pac!et routing and caching.

    "n computer science, the analysis of algorithms is the determination of

    the amount of resources #such as time and storage$ necessary to

    e%ecute them. &ost algorithmsare designed to or! ith inputs of

    arbitrary length. 'sually, the efficiency or running time of an

    algorithm is stated as a function relating the input length to the

    number of steps #time comple%ity$ or storage locations #space

    comple%ity$.

    Algorithm analysisis an important part of a broader computational

    comple%ity theory, hich provides theoretical estimates for the

    resources needed by any algorithm hich solves a given

    computational problem. These estimates provide an insight into

    reasonable directions of search for efficient algorithms.

    "n theoretical analysis of algorithms it is common to estimate their

    comple%ity in the asymptotic sense, i.e., to estimate the comple%ity

    function for arbitrarily large input. (ig ) notation, (ig-omega

    notation and (ig-theta notation are used to this end. *or instance,

    binary searchis said to run in a number of steps proportional to the

    logarithm .Page | 1

    DAV COLLEGE JALANDHAR

    http://en.wikipedia.org/wiki/Algorithm_engineeringhttp://en.wikipedia.org/wiki/Algorithm_engineeringhttp://en.wikipedia.org/wiki/Operation_researchhttp://en.wikipedia.org/wiki/Dynamic_programminghttp://en.wikipedia.org/wiki/Dynamic_programminghttp://en.wikipedia.org/wiki/Divide_and_conquer_algorithmhttp://en.wikipedia.org/wiki/Algorithm_design#cite_note-1http://en.wikipedia.org/wiki/Template_method_patternhttp://en.wikipedia.org/wiki/Decorator_patternhttp://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Computationhttp://en.wikipedia.org/wiki/Algorithmhttp://en.wikipedia.org/wiki/Time_complexityhttp://en.wikipedia.org/wiki/Space_complexityhttp://en.wikipedia.org/wiki/Space_complexityhttp://en.wikipedia.org/wiki/Computational_complexity_theoryhttp://en.wikipedia.org/wiki/Computational_complexity_theoryhttp://en.wikipedia.org/wiki/Computational_problemhttp://en.wikipedia.org/wiki/Algorithmic_efficiencyhttp://en.wikipedia.org/wiki/Big_O_notationhttp://en.wikipedia.org/wiki/Big-omega_notationhttp://en.wikipedia.org/wiki/Big-omega_notationhttp://en.wikipedia.org/wiki/Big-theta_notationhttp://en.wikipedia.org/wiki/Binary_searchhttp://en.wikipedia.org/wiki/Operation_researchhttp://en.wikipedia.org/wiki/Dynamic_programminghttp://en.wikipedia.org/wiki/Dynamic_programminghttp://en.wikipedia.org/wiki/Divide_and_conquer_algorithmhttp://en.wikipedia.org/wiki/Algorithm_design#cite_note-1http://en.wikipedia.org/wiki/Template_method_patternhttp://en.wikipedia.org/wiki/Decorator_patternhttp://en.wikipedia.org/wiki/Computer_sciencehttp://en.wikipedia.org/wiki/Computationhttp://en.wikipedia.org/wiki/Algorithmhttp://en.wikipedia.org/wiki/Time_complexityhttp://en.wikipedia.org/wiki/Space_complexityhttp://en.wikipedia.org/wiki/Space_complexityhttp://en.wikipedia.org/wiki/Computational_complexity_theoryhttp://en.wikipedia.org/wiki/Computational_complexity_theoryhttp://en.wikipedia.org/wiki/Computational_problemhttp://en.wikipedia.org/wiki/Algorithmic_efficiencyhttp://en.wikipedia.org/wiki/Big_O_notationhttp://en.wikipedia.org/wiki/Big-omega_notationhttp://en.wikipedia.org/wiki/Big-omega_notationhttp://en.wikipedia.org/wiki/Big-theta_notationhttp://en.wikipedia.org/wiki/Binary_searchhttp://en.wikipedia.org/wiki/Algorithm_engineeringhttp://en.wikipedia.org/wiki/Algorithm_engineering
  • 7/24/2019 NEW ADA

    2/49

    Algorithm Design And Analysis

    /* PROGRAM TO PERFORM QUIC !ORT U!I"G DI#IDE $CO"QUER TEC%"IQUE*/

    OUTPUT&

    Page | 2

    DAV COLLEGE JALANDHAR

  • 7/24/2019 NEW ADA

    3/49

    Algorithm Design And Analysis

    PROGRAM!&

    /* PROGRAM TO PERFORM QUIC !ORT U!I"G DI#IDE $

    CO"QUER TEC%"IQUE*/

    +includeiostream.h

    +includeconio.h

    +includeprocess.h

    +includectype.h

    +includestring.h

    +define '// 0

    char loer[10]

    char upper[10]

    int top2-1

    void display#int s[],int n$

    int main#$

    3

    void quic!sort#int s[],int n$

    int n210

    clrscr#$

    int s[]2341,15,67,87,91,:8,9;,;:,79,75n>n=

    display#s,n$

    quic!sort#s,n$

    cout=Afetr Sorting>n>n=

    display#s,n$Page | 3

    DAV COLLEGE JALANDHAR

  • 7/24/2019 NEW ADA

    4/49

    Algorithm Design And Analysis

    cout=>n?nd of the program=

    getch#$

    return 0

    n=