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
Olin [163]
2 years ago
13

Calculate the time complexity for the following function in terms of Big O notation. Explain your answer.

Computers and Technology
1 answer:
DerKrebs [107]2 years ago
4 0

Answer: It is 1 int count = 0;

2 for (int i = n; i >= 0; i /= 2)

3 count += i;

4 for (int j = 0; j < n; j++)

5 count +=j;

6 return count;

SO it is j(0-(-n)

Explanation: Im dum

You might be interested in
The process of changing a program’s internal structure without changing the way the program works is ______________.
aev [14]

Explanation: changing the coding and not the way it works.

7 0
3 years ago
Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
otez555 [7]

Answer:

The program written in python is as follows

def countchr(phrase, char):

     count = 0

     for i in range(len(phrase)):

           if phrase[i] == char:

                 count = count + 1

     return count

phrase = input("Enter a Phrase: ")

char = input("Enter a character: ")

print("Occurence: ",countchr(phrase,char))

Explanation:

To answer this question, I made use of function

This line defines function countchr

def countchr(phrase, char):

This line initializes count to 0

     count = 0

This line iterates through each character of input phrase

     for i in range(len(phrase)):

This line checks if current character equals input character

           if phrase[i] == char:

The count variable is incremented, if the above condition is true

                 count = count + 1

The total number of occurrence is returned using this line

     return count

The main method starts here; This line prompts user for phrase

phrase = input("Enter a Phrase: ")

This line prompts user for a character

char = input("Enter a character: ")

This line prints the number of occurrence of the input charcater in the input phrase

print("Occurence: ",countchr(phrase,char))

4 0
3 years ago
Windows uses a memory-management technique known as ________ to monitor which applications you use most frequently and then prel
lukranit [14]

Answer:

SuperFetch

Explanation:

Superfetch is a memory management technique on windows service that enables or fetch frequently use applications on systems and launch them faster because the frequently use applications has been preload into the system memory for easy access when they want to be used.

SuperFetch always takes notice of all application running on your system in which when you exit a frequently used application SuperFetch will preload them immediately since it is saved on the system memory.

One of the most important part of Superfetch is that it saves alot of time because you don't have to search the applications before you get access to them in as far as the application was frequently used.

5 0
3 years ago
What is digital museum​
umka2103 [35]

Access hundreds of professional development resources for museum professionals. Museum professionals can benefit at any career stage from student to retiree. Student Membership. Industry Membership. Established Since 1906. Museum Memebership. 501(c)3 Nonprofit Org.

7 0
2 years ago
Read 2 more answers
Provide an example of a question that could NOT be answered with a binary message. Explain why this is the case, making referenc
solong [7]
This is a question with a much simpler answer given its open ended ness - a representation merely means, given binary data, we can determine what 'thing' that binary data corresponds to.

<span>That makes the question unanswerable, because words can all be represented in binary data, and the question cannot be answered without those. Thus, all answers we can convey have a binary representation of some form (that form being the translation of the words we used to communicate the answer into binary data).</span>
7 0
3 years ago
Other questions:
  • One of the original forms of viruses, is usually stored on some form of removable media. When the removable media is connected t
    9·1 answer
  • The numbers on the bottom of a typical check represent all of the following EXCEPT
    14·1 answer
  • Each processor core on a multi core processor generally runs faster than a single core processor
    14·2 answers
  • Your boss is very skeptical about the idea of storing his files up in the cloud rather than on a local storage drive. He asks yo
    7·1 answer
  • Kim is creating a PowerPoint
    13·1 answer
  • Suppose that we want to multiply 500 matrices and we use the optimal parenthesization computed by the MATRIX-CHAIN-ORDER functio
    13·2 answers
  • The printer prints 16 pages every minute. How many pages are printed in 6 minutes?
    14·2 answers
  • Given an initialized variable fileName, write a sequence of statements that create a file whose name is given by the variable an
    15·1 answer
  • a) pencil b) ink bottle c) polygon d) eye 3. Under which of the following can an operating system be classified? b) software c)
    8·1 answer
  • It would be at least two decades before some of
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!