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
Gnom [1K]
1 year ago
9

what is the worst-case big o running time for finding the maximum value in an array of size n by scanning from left to right and

keeping track of the largest value?
Computers and Technology
1 answer:
Aleksandr-060686 [28]1 year ago
6 0

Answer:

spanish

Explanation:

no ingles a me pisquen spanish soy tu amigos teacher

You might be interested in
Explain why it is not necessary for a program to Explain why it is not necessary for a program to be completely free of defects
Lynna [10]
Sometimes you need a trial phase for a program where you see what the people actually like/ want out of the program. Sometimes a fault can actually be something that makes the program better.
7 0
3 years ago
What was the attitude of the U.S. Senate towards the Treaty of Versailles, and why did they have that attitude?​
Arte-miy333 [17]

Answer:

in 1919 the Senate rejected the Treaty of Versailles, which formally ended World War I, in part because President Woodrow Wilson had failed to take senators' objections to the agreement into consideration. They have made the French treaty subject to the authority of the League, which is not to be tolerated. hope it helps in someway ig idk

Explanation:

8 0
3 years ago
CODEHS- Please help!
Ksivusya [100]

Answer:

Revisiting "Build a Tower"

Recall in the last section how we made Karel make a tower of tennis balls. We told Karel to move() and turnLeft() and putBall() until we had a tower. At the end of the program, Karel was still at the top of the tower, like as in the picture below.

Stuck at top

Suppose that now we want Karel to come back down from the top of the tower. The first thing we need to do is get Karel facing in the right direction. One way to do this is to tell Karel

turnLeft();

turnLeft();

turnLeft();

And then tell Karel to

move();

move();

move();

back to the bottom of the tower.

However, telling Karel to turnLeft() three times is not very readable. That's a lot of writing when all we really want is to tell Karel to "turn right."

Explanation:

Hopefully it would help.

8 0
3 years ago
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
o-na [289]

Answer:

I am writing a Python program. Let me know if you want the program in some other programming language.        

import string  #to use string related functions

def wordcount(filename):  # function that takes a text file name as parameter and returns the number of occurrences of every word in file

   file = open(filename, "r")  # open the file in read mode

   wc = dict()  # creates a dictionary

   for sentence in file:  # loop through each line of the file

       sentence = sentence.strip()  #returns the text, removing empty spaces

       sentence=sentence.lower() #converts each line to lowercase to avoid case sensitivity

       sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  #removes punctuation from every line of the text file

       words = sentence.split(" ")  # split the lines into a list of words

       for word in words:  #loops through each word of the file

           if len(word)>2:  #checks if the length of the word is greater than 2

               if word in wc:  # if the word is already in dictionary

                   wc[word] = wc[word] + 1  #if the word is already present in dict wc then add 1 to the count of that word

               else:  #if the word is not already present

                   wc[word] = 1  # word is added to the wc dict and assign 1 to the count of that word                

   for w in list(wc.keys()):  #prints the list of words and their number of occurrences

       print(w, wc[w])  #prints word: occurrences in key:value format of dict        

wordcount("file.txt") #calls wordcount method and passes name of the file to that method

Explanation:

The program has a function wordcount that takes the name of a text file (filename) as parameter.

open() method is used to open the file in read mode. "r" represents the mode and it means read mode. Then a dictionary is created and named as wc. The first for loop, iterates through each line (sentence) of the text file. strip() method is used to remove extra empty spaces or new line character from each sentence of the file, then each sentence is converted to lower case using lower() method to avoid case sensitivity. Now the words "hello" and "Hello" are treated as the same word.

sentence = sentence.translate(sentence.maketrans("", "", string.punctuation))  statement uses two methods i.e. maketrans() and translate(). maketrans() specifies the punctuation characters that are to be deleted from the sentences and returns a translation table. translate() method uses the table that maketrans() returns in order to replace a character to its mapped character and returns the lines of text file after performing these translations.

Next the split() method is used to break these sentences into a list of words. Second for loop iterates through each word of the text file. As its given to ignore words of length 2 or less, so an IF statement is used to check if the length of word is greater than 2. If this statement evaluates to true then next statement: if word in wc:   is executed which checks if the word is already present in dictionary. If this statement evaluates to true then 1 is added to the count of that word. If the word is not already present  then the word is added to the wc dictionary and 1 s assigned to the count of that word.

Next the words along with their occurrences is printed. The program and its output are attached as screenshot. Since the frankenstein.txt' is not provided so I am using my own text file.

4 0
3 years ago
Who is he can anyone help me​
34kurt
This person is Elon Musk, the owner of Tesla :)
5 0
3 years ago
Read 2 more answers
Other questions:
  • Explain what occurs when you synchronize computer and mobile devices.
    5·1 answer
  • Consider a binary-search method in an array that reports whether an object is in the array. The documentation indicates that the
    11·1 answer
  • Xavier would like to change the sort options for his contacts. In which tab will he find the Arrangement command group?
    6·1 answer
  • In Python what are the values passed into functions as input called?
    13·1 answer
  • Write an algorithm for finding the perimeter of a rectangle
    6·1 answer
  • What are 3 similarities and 3 differences between live theatre and film/videos -Drama Class
    13·1 answer
  • I'm showing my friends brainly. Answer with anything so they can see how fast I can get answers.
    10·2 answers
  • Do yall think I should be lonely and quit life!!
    8·2 answers
  • Edhesive 9.3 code practice
    11·1 answer
  • What can handle work that is hard on a person and could cause repetitive injuries?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!