Open In App

Difference between Posteriori and Priori analysis

Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisite – Analysis of Algorithms 
Algorithm is a combination or sequence of finite-state to solve a given problem. If the problem is having more than one solution or algorithm then the best one is decided by the analysis based on two factors. 

  1. CPU Time (Time Complexity)
  2. Main memory space (Space Complexity)

Time complexity of an algorithm can be calculated by using two methods: 

  1. Posteriori Analysis
  2. Priori Analysis

Difference between Aposteriori analysis and A Priori analysis: 
 

A Posteriori analysis A priori analysis
Posteriori analysis is a relative analysis. Priori analysis is an absolute analysis.
It is dependent on language of compiler and type of hardware. It is independent of language of compiler and types of hardware.
It will give exact answer. It will give approximate answer.
It doesn’t use asymptotic notations to represent the time complexity of an algorithm. It uses the asymptotic notations to represent how much time the algorithm will take in order to complete its execution.
The time complexity of an algorithm using a posteriori analysis differ from system to system. The time complexity of an algorithm using a priori analysis is same for every system.
If the time taken by the program is less, then the credit will go to compiler and hardware. If the algorithm running faster, credit goes to the programmer.
It is done after execution of an algorithm. It is done before execution of an algorithm.
It is costlier than priori analysis because  of requirement of software and hardware for execution. It is cheaper than Posteriori Analysis.
Maintenance Phase is required to tune the algorithm. Maintenance Phase is not  required to tune the algorithm.

Last Updated : 12 Dec, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads