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
Lostsunrise [7]
3 years ago
5

How does a linear algorithm perform compared to a quadratic one on our imaginary race track?

Computers and Technology
1 answer:
mixer [17]3 years ago
4 0

Answer:

The linear algorithms have the efficiency O(n). And their speed is always constant. And we need to calculate the efficiency of each of the algorithms for better management and application performance. If the input is big enough then quadratic algorithms O(N*N) always perform below a linear algorithm. And hence, linear programs are better.

Explanation:

Let us take an example of single for loop.

for i in range (1,10):

    print(x)

and second one:

for i in range (1,10):

 for j in range(1,10):

     print(i*j)

In the first single for look the algorithm is linear and it runs for 10 times, and when we increase range to 100 then it runs for 100 times. or O(N) times. However, when we consider two for loops in nested form then, it runs for 10 *10 =100 times and when we increase to 100 then it becomes, 100*100=10000 times. Thus, its complexity is O(N*N). Hence, quadratic algorithms are more complex and takes longer time to be solved.

You might be interested in
Two categories of payroll deductions are required deductions and ___ deductions.
alukav5142 [94]

Answer:

1.)

- C.) Optional

2.)

- D.) Short-term Notes Payable

3.)

- A.) Payroll Sinking Funds

4.)

- A.) A Formal Timekeeping System Is Used

(I'm possibly wrong on the last question, if so then my apologies and I wish you the best of luck.)

3 0
2 years ago
Read 2 more answers
User-system interaction is?
Mandarinka [93]
A multidisciplinary, post-Master<span> educational program which provides practical training in the field of </span>human-computer interaction and user interface design<span>.</span>
8 0
3 years ago
(tco 8) when a file is opened in the append mode, the file pointer is positioned
Artyom0805 [142]
At the end of the file, so that additional data is appended while the existing data stays intact.
6 0
3 years ago
C++
vichka [17]

Answer:

#include <iostream>

#include <map>  

using namespace std;

int main()

{

   map<int, int> numbers;

   cout << "Enter numbers, 0 to finish" << endl;

   int number;

   while (true) {

       cin >> number;

       if (number == 0) break;

       numbers[number]++;

   }

   for (pair<int, int> element : numbers) {

       std::cout << element.first << ": occurs " << element.second << " times" << std::endl;

   }

}

Explanation:

One trick used here is not to keep track of the numbers themselves (since that is not a requirement), but start counting their occurrances right away. An STL map< > is a more suitable construct than a vector< >.

4 0
3 years ago
Gary lives in an area that receives high rainfall throughout the year. Which device would be useful to him to maintain his compu
-BARSIC- [3]

The correct answer is B.UPS

A UPS or Uninterruptable Power supply makes sure that you have backup in case there is a power outage in your area. It provides ample time for you to save all files before shut down.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which strategy are you using when you only read the title, section headings, and captions?
    12·2 answers
  • Which fingers should you use to type the reach keys?
    12·1 answer
  • List and describe four communication tools that are currently popular.
    9·1 answer
  • Technician A says that front and rear U-joints on a RWD axle should operate at different angles to prevent vibration. Technician
    10·1 answer
  • Ad identifies and describes at least four ways to prevent downloading of spyware, adware, and viruses to computer
    9·1 answer
  • Ano ang ibig sabihin ng tanka<br>​
    5·1 answer
  • 5. Compare the telephone network and the internet. What are the similarities? What are the differences?
    12·1 answer
  • The IPv6 address for an Ethernet connection begins with FE80::/64. What does this tell you about the address
    12·1 answer
  • What would be printed to the screen when the following program is run?
    11·1 answer
  • Rewrite the code below so that a transformation moves the div 100px to the right and 50px upward.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!