Prepare a c++ program of the sample run below:
SAMPLE RUN:
Name Q1 Q2 Q3 Q4 Q5
Von 20
Explain in your own words the Analysis of each Array list operation (add, remove and find)?
Consider a Dynamic Array declared inside the code using int* z = new int[10]; . How we will free the memory after we are done with the z array?
Consider a Dynamic Array declared inside the code using int* z = new int[10]; . How we will free the memory after we are done with the z array?
Explain in your own words the Analysis of each Array list operation (add, remove and find)?
Q: Explain the given code in your own words.
find(X): traverse the array until X is located.
int find(int X)
{
int j;
for(j=1; j < size+1; j++ )
if( A[j] == X ) break;
if( j < size+1 ) { // found X
current = j; // current points to where X found
return 1; // 1 for true
}
return 0; // 0 (false) indicates not found