- Related Questions & Answers
- Difference between Impact and Non-Impact Printers
- Difference between Functional and Non-functional Testing.
- Difference between Linear and Non-linear Data Structures
- Difference between Volatile Memory and Non-Volatile Memory
- Difference between correlated and non-collreated subqueries in SQL
- Difference between Primitive and non-primitive datatypes in JavaScript?
- Algorithms and Complexities
- Difference between clustered index and non-clustered index in SQL server
- What is the difference between non-static methods and abstract methods in Java?
- Graphs and its traversal algorithms
- What is the difference between static classes and non-static inner classes in Java?
- Absolute Difference between the Product of Non-Prime numbers and Prime numbers of an Array?
- Absolute Difference between the Sum of Non-Prime numbers and Prime numbers of an Array?
- Rebalancing Algorithms
- Difference between JCoClient and JCoDestination

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

In the context of programming, an Algorithm is a set of well-defined instructions in sequence to perform a particular task and achieve the desired output. Here we say set of defined instructions which means that somewhere user knows the outcome of those instructions if they get executed in the expected manner.

On the basis of the knowledge about outcome of the instructions, there are two types of algorithms namely − Deterministic and Non-deterministic Algorithms. Following are the main differences between both of the algorithms −

Sr. No. | Key | Deterministic Algorithm | Non-deterministic Algorithm |
---|---|---|---|

1 | Definition | The algorithms in which the result of every algorithm is uniquely defined are known as the Deterministic Algorithm. In other words, we can say that the deterministic algorithm is the algorithm that performs fixed number of steps and always get finished with an accept or reject state with the same result. | On other hand, the algorithms in which the result of every algorithm is not uniquely defined and result could be random are known as the Non-Deterministic Algorithm. |

2 | Execution | In Deterministic Algorithms execution, the target machine executes the same instruction and results same outcome which is not dependent on the way or process in which instruction get executed. | On other hand in case of Non-Deterministic Algorithms, the machine executing each operation is allowed to choose any one of these outcomes subjects to a determination condition to be defined later. |

3 | Type | On the basis of execution and outcome in case of Deterministic algorithm, they are also classified as reliable algorithms as for a particular input instructions the machine will give always the same output. | On other hand Non deterministic algorithm are classified as non-reliable algorithms for a particular input the machine will give different output on different executions. |

4 | Execution Time | As outcome is known and is consistent on different executions so Deterministic algorithm takes polynomial time for their execution. | On other hand as outcome is not known and is non-consistent on different executions so Non-Deterministic algorithm could not get executed in polynomial time. |

5 | Execution path | In deterministic algorithm the path of execution for algorithm is same in every execution. | On other hand in case of Non-Deterministic algorithm the path of execution is not same for algorithm in every execution and could take any random path for its execution. |

Advertisements