Question: 2 - The following function determines if all the numbers in the vector are different from each other, i . e . they are all
The following function determines if all the numbers in the vector are different from each other, ie they are all distinct values. Show that the function runs in On Count the number of operations and determine the BigO function. You must show all steps on how to determine the Big O including the values of C and n points
bool allDistinctconst vector& a # of primitive operations
for int i ; i asize; i
for int j i; j asize; j
if ai aj
return false;
return true;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
