Back to Course


0% Complete
0/82 Steps
  1. Getting Started with Algorithm
    What is an Algorithm?
  2. Characteristics of Algorithm
    1 Topic
  3. Analysis Framework
  4. Performance Analysis
    3 Topics
  5. Mathematical Analysis
    2 Topics
  6. Sorting Algorithm
    Sorting Algorithm
    10 Topics
  7. Searching Algorithm
    6 Topics
  8. Fundamental of Data Structures
  9. Queues
  10. Graphs
  11. Trees
  12. Sets
  13. Dictionaries
  14. Divide and Conquer
    General Method
  15. Binary Search
  16. Recurrence Equation for Divide and Conquer
  17. Finding the Maximum and Minimum
  18. Merge Sort
  19. Quick Sort
  20. Stassen’s Matrix Multiplication
  21. Advantages and Disadvantages of Divide and Conquer
  22. Decrease and Conquer
    Insertion Sort
  23. Topological Sort
  24. Greedy Method
    General Method
  25. Coin Change Problem
  26. Knapsack Problem
  27. Job Sequencing with Deadlines
  28. Minimum Cost Spanning Trees
    2 Topics
  29. Single Source Shortest Paths
    1 Topic
  30. Optimal Tree Problem
    1 Topic
  31. Transform and Conquer Approach
    1 Topic
  32. Dynamic Programming
    General Method with Examples
  33. Multistage Graphs
  34. Transitive Closure
    1 Topic
  35. All Pairs Shortest Paths
    6 Topics
  36. Backtracking
    General Method
  37. N-Queens Problem
  38. Sum of Subsets problem
  39. Graph Coloring
  40. Hamiltonian Cycles
  41. Branch and Bound
    2 Topics
  42. 0/1 Knapsack problem
    2 Topics
  43. NP-Complete and NP-Hard Problems
    1 Topic
Lesson 1 of 43
In Progress

What is an Algorithm?

An Algorithm is a sequence of steps designed for programming a computer to solve a specific problem normally by using the machine.

In simple terms –  An algorithm is a finite set of instructions that, if followed, accomplishes a particular task.

The reference to “instructions” in the definition implies that there is something or someone capable of understanding and following the instructions given.

We call this a “computer,” keeping in mind that before the electronic computer was invented, the word “computer” meant a human being involved in performing numeric calculations. Nowadays, of course, “computers” are those ubiquitous electronic devices that have become indispensable in almost everything we do.

Note, however, that although the majority of algorithms are indeed intended for eventual computer implementation, the notion of algorithm does not depend on such an assumption.

As examples illustrating the notion of the algorithm, we consider in this section three methods for solving the same problem: computing the greatest common divisor of two integers. These examples will help us to illustrate several important points:

  • The non-ambiguity requirement for each step of an algorithm cannot be compromised.
  • The range of inputs for which an algorithm works has to be specified carefully.
  • The same algorithm can be represented in several different ways.
  • There may exist several algorithms for solving the same problem
  • Algorithms for the same problem can be based on very different ideas and can solve the problem with dramatically different speeds.
KodNest Capture
The notion of the Algorithm

Next you have to learn what are the steps involved in designing an Algorithm ?

These are steps involved in designing a Algorithm :-

STEP 1 –  Defining the  goal that has to be accomplished.
STEP 2 – Figure out the steps using which the goal has to be accomplished and list down the steps clearly

If the above two steps are orderly performed, there it is …. An Algorithm is Designed !

Complicated ?? Lets simplify it using an Example,

Say supposing we have a dozen mango’s and we have to find the biggest amongst them.

Now, lets design an algorithm for achieving the same using the steps involved in designing an algorithm .


Finding the biggest mango (goal that has to be accomplished)


Step a) consider 3 baskets say, basket-A, basket-B, basket-C.

Step b) Let basket-A contain all the mangoes , let basket-B and basket- C be empty.

Step c) pick a mango from basket-A

Step d) if it is first time that the mango is picked then place it in basket-C

Step e) if it is not the first pick, then compare the picked mango with the one which is placed in basket-C

Step f) if it weighs less than the one in basket-C, then put it into the basket-B

Step g) if it weighs high, then place it in  basket-C and place the one which you have already placed in basket-C into basket-B

Step h) if there are mangoes still remaining in basket-A then repeat from step c. else check the basket-C you have a biggest one.

Go grab it and eat it, and I call this as mango Eating Algorithm.

Is it simple ?

Then you have to definitely learn the


We can specify the algorithm in TWO ways :-


NATURAL LANGUAGE as in English like statements but, if we use this representation we must make sure that the resulting instructions are specific


PSEUDOCODE LANGUAGE  is a combination of both natural language and programming language .  A pseudo code is usually more precise than natural language.

New Report