1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GenaCL600 [577]
3 years ago
9

. Consider the problem of finding the largest element in a list of n elements. What will be the basic operation of an algorithm

to solve this problem?
assignment

addition

looping

comparesn
Computers and Technology
1 answer:
natali 33 [55]3 years ago
4 0

Answer:

Comparison.

Explanation:

When we have to find a largest in a list of n elements.First we have to iterate over the list so we can access all the elements of the list in one go.Then to find the largest element in the list we have to initialize a variable outside the loop with the minimum value possible and in the loop compare each element with this value,if the element is greater than the variable assign the element to the variable.Then the loop will find the largest element and it will be the variable.

You might be interested in
Why is it important to use standard english when applying for a job
algol13
To start of on the right foot with your boss by showing him/her that you can be professional, but not be intimidating. Hope this helped.
8 0
3 years ago
Read 2 more answers
Which of the following best describes the impact of Creative Commons?
Pachacha [2.7K]

Answer:

it’s just a screenie hope it helps

8 0
2 years ago
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have alre
Fudgin [204]

Answer:

The c++ program to implement the while loop is given below.

#include <iostream>

using namespace std;

int main() {

  // declaration of integer variables

   int k, n, total;

   // initialization of integer variables

   k=1, n=4, total=0;

//  loop executed till value of k becomes equal to value of n

   while( k <= n ){

       // cube of every integer is added to the variable total

       total = total + ( k * k * k );

       // value of k is incremented to go to the next number

k = k + 1 ;

   }  

   return 0;

}  

Explanation:

The program begins with the declaration of integer variables.  

int k, n, total;

This is followed by initialization of these variables.

k=1, n=4, total=0;

The while loop runs over the variable k which is initialized to 1. The loop runs till value of k reaches the value of integer n.

First, cube of k is computed and added to the variable total.

After first execution of the loop, total is initialized to the cube of 1.

Next, value of variable k is incremented by 1 so that k is initialized to next integer.

After first execution of the loop, k is incremented from 1 to 2.

while( k <= n )

{

total = total + ( k * k * k );

k = k + 1 ;

   }

When the value of k reaches the value of integer n, the cube of n is calculated and added to the variable, total.

When k is incremented, it becomes more than n and hence, loop gets terminated.

As the return type of main is int, the program terminates with the statement shown below.

return 0;

No output is displayed as it is not mentioned in the question.

No user input is taken as it is mentioned that integer variables are already initialized.

4 0
3 years ago
Are u a chicken nugget!!??
creativ13 [48]
Yes. Yes I would classify myself as the nugget of the chicken thank you for asking me. 
3 0
3 years ago
Read 2 more answers
In an advertisement, a speed specification, such as 2.66 ghz, indicates the speed of the microprocessor?
Ray Of Light [21]

Answer:

yes / true

Explanation:

it is one of the factors in determining the speed of the microprocessor

5 0
1 year ago
Other questions:
  • Part 1: Create an application that allows you to enter student data that consists of an ID number, first name, last name, and gr
    14·1 answer
  • Whats a computer scientist.
    5·2 answers
  • If you need assistance with your I-20 which phone number at UC would you call?
    10·1 answer
  • Which technique helps you look confident as a speaker?
    15·1 answer
  • Why is the answer B?
    6·1 answer
  • The "fathers of the Internet" are Vinton Cerf and ________. Select one: A. Tim Berners-Lee B. Bill Gates C. Robert Kahn D. Rober
    8·1 answer
  • In an information systems framework, ________ is the bridge between the computer side on the left and the human side on the righ
    14·1 answer
  • The ability to understand a person's needs or intentions in the workplace is demonstrating
    5·1 answer
  • Anyone who do bug bounty hunt ?​
    10·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!