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
Yuliya22 [10]
2 years ago
6

How do we find the time complexity for this algorithm?

Computers and Technology
1 answer:
gizmo_the_mogwai [7]2 years ago
8 0

Answer:

For any loop, we find out the runtime of the block inside them and multiply it by the number of times the program will repeat the loop. All loops that grow proportionally to the input size have a linear time complexity O(n) . If you loop through only half of the array, that's still O(n) .

You might be interested in
Eureka! Is a telephone and Internet-based concierge service that specializes in obtaining things that are hard to find (e.g., Su
svetoff [14.1K]

Explanation:

Should the company separate its voice and data needs, using standard analog services for voice but finding some advanced digital transmission services for data ($40 per month for each voice line and $300 per month for a circuit with 1.5 Mbps for data)?

8 0
2 years ago
Which of the following statements invokes the GetDiscount function, passing it the contents of two Decimal variables named decSa
ryzh [129]

Answer:

c. decDiscount = GetDiscount(decSales, decRate)                                                                                                                          

Explanation:

Option a. is incorrect because it is using Call word which is not a valid way to invoke a function.

Similarly option b. is also incorrect because it uses Call word to invoke function GetDiscount() which is not a valid way to call a function and also it is passing it the contents of three variables decSales, decRate and decDiscount and as mentioned in the question only two parameters are to be passed to GetDiscount() function.

Option c. is correct as it invokes the function GetDiscount() and passes it the contents of two variables decSales and decRate and assigns this to a variable decDiscount. For example if the GetDiscount() method has to calculate the discount using decSales and decRate then the resultant value of this computation is assigned to decDiscount. So whatever this function returns or computers is assigned to and stored in decDiscount variable. So this is a valid way to invoke a method.

3 0
2 years ago
in java how do i Write a method named isEven that accepts an int argument. The method should return true if the argument is even
Veseljchak [2.6K]
<h2>Answer:</h2><h2>============================================</h2>

//Class header definition

public class TestEven {

   

   //Method main to test the method isEven

   public static void main(String args[ ] ) {

       

       //Test the method isEven using numbers 5 and 6 as arguments

       System.out.println(isEven(5));

       System.out.println(isEven(6));

     

   }

   

   //Method isEven

   //Method has a return type of boolean since it returns true or false.

   //Method has an int parameter

   public static boolean isEven(int number){

       //A number is even if its modulus with 2 gives zero

      if (number % 2 == 0){

           return true;

       }

       

       //Otherwise, the number is odd

       return false;

   }

}

====================================================

<h2>Sample Output:</h2>

=========================================================

false

true

==========================================================

<h2>Explanation:</h2>

The above code has been written in Java. It contains comments explaining every part of the code. Please go through the comments in the code.

A sample output has also been provided. You can save the code as TestEven.java and run it on your machine.

3 0
3 years ago
When your purchases are swiped over the bar-code reader at the point-of-sale terminals at Wal-Mart, a _____ records the data.
nydimaria [60]

Answer: Transaction processing system

Explanation:

A transaction processing system basically records all the data in the system. It is the set of data that basically monitor all the transaction process in the system. It basically perform various transaction oriented applications in the system.

It also allow time delay in the system when the item is supposed to being sold to the actually selling of the item. There are basically various types of transaction processing system arr payroll, account payable and the inventory control.

4 0
3 years ago
Why is it important to recognize web address endings? to know the type of information on a site to determine if the site’s infor
seraphim [82]

Answer: To know the type of information on a site.

Website address endings are known as domain extensions. In our current society, the domain extensions or website endings are indicators of what information or content the website will contain. By recognizing these domain extensions, you will have a clear understanding of what to expect from the website.

Some examples of these domain extensions are:

.edu

- The .edu extension indicates that the website is related to educational content.

.org

- The .org extensions indicates that the website is related to free organizations.

.com

- The ever famous .com extension is an indicator of a commercial type of website.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Select one technology limitation in regards to quality improvement (QI) programs Technology is not fast enough Not all electroni
    12·1 answer
  • You will write a program that reads a binary file that contains records of creatures. Each record can be stored in a Creature st
    10·1 answer
  • Hello my friends i am trying to reboot my i phone 4 but i could not i tried many ways can u help me
    14·1 answer
  • What is x squared times b squared
    8·1 answer
  • Viết thuật toán, chương trình xử lý hạn chế trong việc xử lý số liệu phần nguyên để hiển thị lên lcd
    14·1 answer
  • WHO SAYS BUP ALL THE TIME ​
    8·1 answer
  • Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
    7·1 answer
  • Question 1 of 20 Gus has decided to organize his inbox on June 26 by using folders and deleting irrelevant messages. He creates
    14·2 answers
  • What is the advantage of learning through story compared to learning through personal experience?
    15·2 answers
  • Which type of service offers a preconfigured testing environment for application developers to create new software applications
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!