Question: Given a program in pseudo code below to exhaustively search a unique value named Key in X, what is the running time Big-O of the
- Given a program in pseudo code below to exhaustively search a unique value named Key in X, what is the running time Big-O of the algorithm?
// the following program is in pseudo code which // is not executable
// The goal is to find a unique value key in a // traditional two-dimensional array X
include
using namespace std;
const int row = n;
const int column = n;
int X[row][column];
for (int i = 0; i for (int j=0; j { If (X[i][j] == Key) break; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
