- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies

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

# Difference between Deterministic and Non-deterministic Algorithms

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. |

- Related Articles
- Distinguish between non-deterministic, deterministic and Turing Machine computational models?
- Can we convert a non-deterministic finite automata into a deterministic finite Automata?
- What is Non deterministic finite automata?
- Explain about a non-deterministic Turing Machine?
- Explain Non-Deterministic Finite Automata in TOC.
- What is Non-Deterministic Finite Automata (NFA)?
- Write the difference between 'Random experiment' And 'Deterministic experiment'. Give examples.
- Explain non-deterministic push down automata in TOC?
- What is Deterministic Routing?
- Difference between Adaptive and Non Adaptive routing algorithms
- Explain if the CFG is recognized by Non-deterministic push down automata
- Explain Deterministic Finite Automata in TOC.
- What is Deterministic Finite Automata (DFA)?
- Construct Deterministic PDA for a^n b^n where n>=1
- Non-adaptive Routing Algorithms

Advertisements