Skip to main content

Afiiliate Program

 1. Amazon Afiiliate Link  https://amzn.to/3wZR1pz  https://amzn.to/3x5KGt3 The Amazon Affiliate program, also called "Amazon Associates," can be an easy way to monetize your website or blog. Simply sign up, receive immediate approval, and place Amazon affiliate links on your site. When someone makes an Amazon purchase via one of your links, you get the commission — it's that simple. 2. Flipkart Affiliate Link https://www.flipkart.com/?affid=vatsalgup2

What is Algorithm

 

Algorithm

A finite set of instructions that specifies a sequence of operation is to be carried out in order to solve a specific problem or class of problems is called an Algorithm.

An algorithm can be defined as a well-defined computational procedure that takes some values or the set of values, as an input and produces some value, or the set of values, as an output. An algorithm is thus a sequence of computational steps that transform the input into output.


It describes the specific computational procedures for achieving the input-output relationship.


An algorithm must have the following properties:


  • Correctness: It should produce the output according to the requirement of the algorithm.

  • Finiteness: Algorithm must complete after a finite number of instructions have been executed.

  • An Absence of Ambiguity: Each step must be defined having only one interpretation.

  • Definition of Sequence: Each step 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.

  • Flexibility: It should also be possible to make changes in the algorithm without putting so much effort on it.

  • Efficient: Efficiency is always measured in terms of time and space requires implementing the algorithm, so the  algorithm uses a little running time and memory space as possible within the limits of acceptable development time.

  • Independent: An algorithm should focus on what are inputs,outputs and how to derive output without knowing the language it is defined. Therefore, we can say that the algorithm is independent of language.


Characteristics of Algorithm


1. Input- Every algorithm may have 0 or more Input.

2. Output- Every algorithm should have at least 1 output.

3. Finiteness- Every algorithm must be terminated in finite time and finite steps.

4. Definiteness- Every instruction must be precisely unambiguous(don't have double meaning).

5. Effectiveness- To achieve an effective goal.

 

Program - Program is language  dependent. They are written with syntax. They are written in formal way.


What are the steps to solve Program Development?

1. Problem Definition- Input, Output, Types of Input, Types of output. Aim of the problem, Goal of

 problem, Example. 

2. Problem Analysis

3. Algorithm/Flowchart

4. Coding

5. Debugging/Testing

6. Documentation

7. Maintenance and Modification


Difference between Algorithm and Program


Algorithm

Program

Algorithms are language Independent.

Programs are language dependent.

It is written without syntax.

They are written with syntax.

It is written in Informal way.

They are written in a formal way.


Comments

Post a Comment

Popular posts from this blog

Asymptotic Notation

Asymptotic  Notation Asymptotic notations are mathematical tools to represent time complexity of algorithms. Asymptotic notations are used to write fastest and slowest possible running time for an algorithm. These notations are important because  without expanding the cost of running the algorithm, we can estimate the complexity of the algorithm. Asymptotic notations is a way of comparing functions that ignores constant factors and small input size. Big Oh Notation(O) The notation O(n) is the formal way to express the upper bound of an algorithm’s running time. It measures the worst case time complexity or the longest amount of time an algorithm can possibly take to complete. Example - Insertion  Sort  f(n) = O(g(n)) If and only if exist positive constant C f(n) <= k.g(n) for n>n0 in all cases. Omega Notation(Ω) The notation Ω(n) is the formal way to express the lower bound of an algorithm’s running time. It measures the best case time complexity or the be...

Graph coloring

  Graph Coloring A graph G(V, E) is given and some colors are given We have to color the vertices such that no two neighbours/adjacent vertices have the same color. This can be solved using Backtracking. There are two types of problem 1.  m-colorability decision problem If a graph G(V, E) is given and some colors are also given and just we want to know whether a graph can coloured using those colors or not. This is known as the m-coloring decision problem. 2.  m-colorability optimization problem If a graph G(V, E) is given and we want to know minimum how many colors required for coloring the graph. This problem is called the m-coloring optimization problem. Chromatic Number: The smallest number of colors needed to color a graph G is called its chromatic number.