Answer:
Explanation:
#include<iostream>
#include<ctime>
#include<bits/stdc++.h>
using namespace std;
double calculate(double arr[], int l)
{
double avg=0.0;
int x;
for(x=0;x<l;x++)
{
avg+=arr[x];
}
avg/=l;
return avg;
}
int biggest(int arr[], int n)
{
int x,idx,big=-1;
for(x=0;x<n;x++)
{
if(arr[x]>big)
{
big=arr[x];
idx=x;
}
}
return idx;
}
int main()
{
vector<pair<int,double> >result;
cout<<"Enter 1 for iteration\nEnter 2 for exit\n";
int choice;
cin>>choice;
while(choice!=2)
{
int n,m;
cout<<"Enter N"<<endl;
cin>>n;
cout<<"Enter M"<<endl;
cin>>m;
int c=m;
double running_time[c];
while(c>0)
{
int arr[n];
int x;
for(x=0;x<n;x++)
{
arr[x] = rand();
}
clock_t start = clock();
int pos = biggest(arr,n);
clock_t t_end = clock();
c--;
running_time[c] = 1000.0*(t_end-start)/CLOCKS_PER_SEC;
}
double avg_running_time = calculate(running_time,m);
result.push_back(make_pair(n,avg_running_time));
cout<<"Enter 1 for iteration\nEnter 2 for exit\n";
cin>>choice;
}
for(int x=0;x<result.size();x++)
{
cout<<result[x].first<<" "<<result[x].second<<endl;
}
}
Answer:
C. Use the SOAP API to maintain the related SObject_share records
The indices of the internal array elements that hold the remaining elements is c) 2 to 4
<h3>Calculations and Parameters:</h3>
For us to create a capacity of 10 for the queue, we would enqueue:
We would create a queue of capacity 10:
<h3>Queue q(10);</h3>
We add elements/enqueue 5 elements to the queue :
- q.queueEnqueue(10);
- q.queueEnqueue(5);
- q.queueEnqueue(8);
- q.queueEnqueue(9);
- q.queueEnqueue(2);
Printing this would give:
q. queueDisplay()
10, 5, 8, 9, 2
Next, we would remove elements/dequeue 2 elements from the queue :
q. queuedequeue();
q. queuedequeue();
Printing it would be:
q. queueDisplay()
8 ,9, 2
Observing this, the deletion/dequeue starts from the front/first index.
The remaining indices of the internal array elements are: 2, 3, 4 or 2 to 4
Read more about arrays and enqueue here:
brainly.com/question/24188935
#SPJ1
Android<span>, </span>iOS<span>, Windows and </span>Blackberry<span> devices.</span>