Skip to main content

Design and Analysis of Algorithms Tutorial

What is DAA Algorithm?
algorithm









An algorithm is any well-defined computational action that takes some values, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational procedure that transforms the input into output.
An algorithm is an abstraction of the program to be executed on a physical machine (model of computation).


Why study DAA Algorithm?


As the speed of processor increases, performance is generally said to be less central than other software quality nature (e.g., security, extensibility, reusability, etc.). However, large problem sizes are commonplace in the field of computational science, which makes performance a significant factor. This is because longer computation time, to name a few mean slower results, less through research and largest cost of computation (if buying CPU Hours from an external party). The study of Algorithm, therefore, gives us a language to express performance as an act of problem size.


Properties of Algorithm:

Correctness: It should produce the output according to the need of
the algorithm.
Finiteness: Algorithm must complete after a restricted number of
instruction has been executed.
An Absence of Ambiguity: Each step must be defined, having only one interpretation.
Definition of Sequence: Each procedure must have a unique
defined preceding and succeeding step. The first step and the last
step must be noted.
Input/output: Number and classification of needed inputs and results must be stated.
Feasibility: It must be feasible to execute each instruction.


The complexity of Algorithm:

It is very convenient to analyze algorithm based on the relative amount of time on a relative amount of space they required and specify the growth of time/space requirement as a function of input size.
1.  Time Complexity: Running time of a program as a behavior of the size of the input.
2.  Space Complexity: Some forms of analysis could be done based on how much space an algorithm needs to complete its task. This space complexity analysis was critical in the initial days of computing when storage space on the computer was defined. When considering this algorithm are divided into those that use extra space to do their work and those that work in place.


Broadly, we obtain the following types of analysis:-

  • Worst-case: f (n) described by the maximum number of steps taken on any instance of size n.
  • Best-case: f (n) described by the minimum number of steps taken on any instance of size n.
  • Average case: f (n) described by the average number of steps taken on any instance of size n.
Algorithm Design Techniques: The following is an index of    several popular design approaches:
1. Divide and Conquer Approach:  It is a top-down approach. The algorithms which follow the divide & conquer approach involve three steps:
  • Divide the original problem into a set of subproblems.
  • Solve every subproblem individually, recursively.
  • Combine the solution of the subproblems (top level) into a solution of the whole original problem.
2. Greedy Technique: Greedy method is used to solve the optimization problem. An optimization problem is one in which we are given a set of input values, which are mandatory either to be maximized or minimized (known as objective),i.e. some constraints or conditions.

  • Greedy Algorithm ever makes a choice (greedy criteria) looks best at the moment, to optimize a given objective.
  • The greedy algorithm doesn’t always guarantee the optimal solution however it usually produces a solution that is very close in value to the optimal.

3. Dynamic Programming:  Dynamic Programming is a bottom-up approach we solve all possible small problems and then link them to obtain solutions for more significant problems.

4. Randomized Algorithms: A randomized algorithm is defined as an algorithm that is allowed to access a source of independent, unbiased random bits, and it is then allowed to need these random bits to influence its computation.

5. Backtracking Algorithm: Backtracking Algorithm tries each possibility until they find the right one. It is a depth-first search of the set of feasible solution. During the search, if an alternative doesn’t work, then backtrack to the choice point, the place which presented clear options, and tries the next opportunity.



    Comments

    Popular posts from this blog

    Introduction To HTML Tutorial

    What is HTML? ·                         HTML is a computer standard Markup language, which is used for creating web pages or web applications. HTML stands for Hypertext Markup Language , where Hypertext refers to link two web pages, and Markup is a computer language which is used to apply layout and formatting for a page. A web browser receives an HTML document from the server and converts it into a webpage.  Following is a simple example for HTML page which gives an idea about how HTML page        looks:        <!DOCTYPE html> <html> <head>                 <title>This is title</title> </head>  <body>    <h1>This is a web-page</h1>    <p>This is First paragraph</p>  </body> </html>      In above example we have used tags, and elements which are building blocks of HTML. Such as <head>, <body>, <h1>, and <p> we will understand about these tags