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:
Hi there! This question is good to check your knowledge of entities and their relationships. The diagram and explanation are provided below.
Explanation:
The entity relationship diagram for the association between the entities according to the description in the question is drawn in the first attachment. We can further simplify the relationship by removing this many to many relationship between "Chemists" and "Projects" by adding another entity called "Worklist" as detailed in second attachment.
GFE stands for Government Furnished Equipment. While AUP is Acceptable Use Policy (AUP). The AUP should be read and signed by employees annually. <span><span> </span></span>The statement that "When issued a GFE device, you are required to sign an AUP" is true.
Answer:
The correct answer is d. Algorithms may be inefficient when used by a human brain.
Explanation:
This is a situation typical of algorithms, since in order for them to work perfectly, the participation of people who carry out the necessary tests is required for the new creation to be useful in a specific field. Algorithms are logical operations determined according to a pattern, but the functioning of the human brain is in many cases different from a simple algorithm, since it associates situations and, depending on their complexity, also solves them.