Save time and save paper and protect the environment
Answer:
// C++ program to find k largest elements in the array
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable
int n,k;
cout<<"Enter the number of elements of array:";
// read the value of n
cin>>n;
// declare the array of size n
int arr[n];
cout<<"Enter the elements of array:";
// read the elements of array
for(int a=0;a<n;a++)
{
cin>>arr[a];
}
cout<<"Enter the value of K:";
cin>>k;
// call the function to perform selection Sort
sort(arr, arr+n);
cout << k<<" largest elements of the array are: ";
// print k largest elements of the array
for (int i=n-1; i>n-k-1; i--)
cout << arr[i] << " ";
return 0;
}
Explanation:
Read the number of elements in the array.Then create an array of size "n" and read n elements of the array.Sort the array in ascending array.Then Read the value of k from user.Find the k Elements from the end of the array.This will be the k largest elements of the array.
Output:
Enter the number of elements of array:8
Enter the elements of array:34 8 75 99 12 7 5 55
Enter the value of K:3
3 largest elements of the array are: 99 75 55
Answer:
Running time of algorithm is O(n).
Explanation:
n is power of 2
n =2,4,8,16,32,...................................
A is an array having n elements
B is an array of size 0 to (n/2)-1
if n=4 B then (4/2)-1 =1 So B has size 2
for(i=0;i<=(n/2)-1;++)
{
B[i]=A[2i]+A[2i+1];
}
This for loop will run n/2 times so complexity in terms of Big Oh is O(n/2) =O(n)
Running time of algorithm is O(n).
Answer: (C) Confirm project requirement
Explanation:
The configuration management is the type of system and it is collection of the formal document that is use to applying for the technical direction. It is the subsystem of the management system of the project.
It basically record each change occur in the project and then report the each change status in the project. It also control various physical characteristics in the project.
It identify all the physical and the functional characteristics of any type of service, result and product in the project document. It basically include the tracking system that is used for the document authorizing and also for the controlling purpose.
Electronic control unit (ECU)is a general term for any of a number of computer modules that receive input from sensors in your automobile and control different electrical functions
The ECM is basically an on-board computer in your car it is the most common
On-board diagnostics (OBD) is an automotive term referring to a vehicle's self-diagnostic and reporting capability.
ABS controls anti lock breaks