Question: Can someone comment this algorithm and discuss the time complexity of this algorithm in terms of the size of the inputs X and Y? The
Can someone comment this algorithm and discuss the time complexity of this algorithm in terms of the size of the inputs X and Y?
The algorithm takes two 2-Dimensional arrays which represents the black and white images. The algorithm compares the two arrays and declares that the images are similar or not.
This algorithm compares each row in the two 2 dimensional arrays and computes the difference of each row. The algorithm finds the minimum difference of each row and stores it in a separate variable. Finally, the algorithm aggregates the minimum difference of each row. The algorithm outputs Images are different if the total difference is greater than threshold value else it outputs Images are similar.
The pseudocode for the algorithm Compareimages is as follows:

Can someone comment this algorithm and discuss the time complexity of this algorithm in terms of the size of the inputs X and Y?
void compareimages (int x[M] [N], int y[M] [N], int thresh) { for (int a = 0; a
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
