A deterministic algorithm is one whose behavior is completely determined by its inputs and the sequence of its instructions. | A non-deterministic algorithm is one in which the outcome cannot be predicted with certainty, even if the inputs are known. |
For a particular input, the computer will give always the same output. | For a particular input the computer may give different outputs on different execution. |
Can determine the next step of execution. | Cannot determine the next step of execution due to more than one path the algorithm can take. |
Operation are uniquely defined. | Operation are not uniquely defined. |
Like linear search and binary search | like travelling salesman person and evaluate boolean parenthesis to true. |
Deterministic algorithms usually have a well-defined worst-case time complexity. | Time complexity of non-deterministic algorithms is often described in terms of expected running time. |
Deterministic algorithms are entirely predictable and always produce the same output for the same input. | Non-deterministic algorithms may produce different outputs for the same input due to random events or other factors. |
Deterministic algorithms usually provide precise solutions to problems. | non-deterministic algorithms often provide approximate solutions to the problems. |
Deterministic algorithms are commonly used in applications where precision is critical, such as in cryptography, numerical analysis, and computer graphics. | Non-deterministic algorithms are often used in applications where finding an exact solution is difficult or impractical, such as in artificial intelligence, machine learning, and optimization problems. |
Examples of deterministic algorithms include sorting algorithms like bubble sort, insertion sort, and selection sort, as well as many numerical algorithms. | Examples of non-deterministic algorithms include probabilistic algorithms like Monte Carlo methods, genetic algorithms, and simulated annealing. |