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
krok68 [10]
4 years ago
15

Consider the following pseudocode. How much time does the code take to execute? Express all answers in terms of the input variab

le n, using Big-Oh O( ) notation.void george(int n) {int m = n;while (m > 1){ for (int i = 1; i < m; i++) int S = 1; m = m/2; }}
Computers and Technology
1 answer:
weeeeeb [17]4 years ago
6 0

Answer:

Time the code takes to execute is O(n²)

Explanation:

The code forms an arithmetic series using it two loops.

n+(n-1)+(n-2)+........+2+1

=n(n+1)/2

=O(n²)

You might be interested in
What can help prevent bullying?
hjlf

Sure why are u getting bullied?

7 0
3 years ago
Read 2 more answers
Finish the code where it says //YOUR CODE HERE
victus00 [196]

Answer:This is basically the issue of permutations and calculations. It revolves around the best depiction of accuracy.

Explanation: It hitherto explains the nitty-gritty of our day-to-day activities in connection with our social interactions and securities...

6 0
3 years ago
A technician has verified that a video card to be added to a desktop machine will fit and so will a new sound card. What should
yaroslaw [1]

Answremove the old sound and video card

Explanation:

for them to be able to be installed you have to get rid of the one that your trying to replace

7 0
4 years ago
Plz help me! No guessing plz!
Tomtit [17]
C- World Wide Web - It has all web pages and files delivered by web servers 
4 0
4 years ago
Design the program that reads two files and compares their contents. The program calls a method that reads the file one line at
Advocard [28]

Answer:

file1 = []

file2 = []

fileone = "lyric1.txt"

filetwo = "lyric2.txt"

def linereader( myfile, mylist):

   for line in open(myfile, "r") as file:

       line_read = readlines( line)

       mylist.append( line_read)

   file.close()

linereader( fileone, file1)

linereader( filetwo, file2)

# Assuming both files have same number of lines.

for index, item in enumerate(zip(file1, file2)):

   if item[0] != item[1]:

       print( index + 1, item)

Explanation:

The python code compares two files and returns the number and the lines from both files that do not match. The source code opens the files lyric1.txt and lyric2.txt reading each lines to different lists which are iterated to compare its items returning the number of the line and the unequal lines.

5 0
3 years ago
Other questions:
  • a. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balance
    15·1 answer
  • "a router interface has been assigned an ip address of 172.16.192.166 with a mask of 255.255.255.252. to which subnet does the i
    5·1 answer
  • Why are networked systems beneficial?
    9·2 answers
  • What do you think of explaining to young people, from high school, the legitimacy of copyright and the dangers they can run on t
    11·1 answer
  • What version of android did nexus one run?
    14·1 answer
  • What kind of programming language allows you to use a vocabulary of reasonable terms such as "read," "write," or "add" instead o
    13·1 answer
  • What protocol communicates data between routers representing the edges of autonomous systems?Distance-vectorLink stateInterior g
    11·1 answer
  • Help me pls!!! last question
    9·1 answer
  • Codehs dartboard 3.12.4
    9·1 answer
  • The set Canvas.PaintColor to block sets the paint color for the _____ .
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!