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
11111nata11111 [884]
3 years ago
10

What is the worst case running time of a linear search?

Computers and Technology
2 answers:
shtirl [24]3 years ago
3 0

Answer:

The worst case running time of a linear search is O(N).

Explanation:

In a linear search, you will run the program looking at each array position until you find your desired information.

The best case scenario is when you find it at the first position.

The worst case scenario is when you find the value at the last array position. So, in a N-length array, the information is at position N. This means that the worst case running time of a linear search is O(N).

Elan Coil [88]3 years ago
3 0

Answer:

o(n)

Explanation:

You might be interested in
Write a program that reads a string from the user containing a date in the form mm/dd/ yyyy. It should print the date in the for
Oxana [17]

Answer:

months_info = ['January', 'February','March','April', 'May','June', 'July','August', 'September', 'October', 'November', 'December']

date = input('Enter a date using the mm/dd/yyyy format ')

m, d, y = date.split('/')

m = int(m) - 1

name_of_month = months_info[m]

print('{} {}, {}'.format(name_of_month, d, y))

Explanation:

  • Create a list of all months and store them in the months_info variable.
  • Get the date as an input from user and then split the date.
  • Finally display the date by following the specific layout using the built-in format method.
3 0
3 years ago
The find_item functions uses binary search to recursively locate an item is the list, returning true if found, false otherwise.
bagirrra123 [75]

Answer:

def find_item(listed, item):

   listed.sort()

   #Returns True if the item is in the list, False if not.

   if len(listed) == 0:

       return False

   middle = int(len(listed)/2)

   #Is the item in the first half of the list?

   if item < listed[middle]:

   #Call the function with the first half of the list

       return find_item(listed[:middle], item)

   

   #Is the item in the center of the list?

   if listed[middle] == item:

       return True

   else:

   #Call the function with the second half of the list

       return find_item(listed[middle+1:], item)

   return False

list_of_names = ["Parker", "Drew", "Cameron", "Logan", "Alex", "Chris", "Terry", "Jamie", "Jordan", "Taylor"]

print(find_item(list_of_names, "Alex")) # True

print(find_item(list_of_names, "Andrew")) # False

print(find_item(list_of_names, "Drew")) # True

print(find_item(list_of_names, "Jared")) # False

Explanation:

The defined python function is used to implement a binary search, the function is recursively called in the function statement, but for it to work on the list ( ie, search for an item in the list), the list must be sorted in ascending order (default).

7 0
3 years ago
Where do you access the status report of an assigned task that is open?
Marina86 [1]

Answer:

I forgot give me time to think abt it cuh

Explanation:

4 0
3 years ago
Read 2 more answers
________ is a process in which computer software that uses statistical analysis, database technology, and artificial intelligenc
QveST [7]

Answer:

Data Mining.

Explanation:

Data Mining is the process in which a computer software uses database technology,artificial intelligence and statistical analysis so that it can find the hidden patterns,connections and trends in the data.To help business owners to make better marketing decisions and predictions about the customer's behavior.

6 0
3 years ago
Is the movie IT really that scary ? Rate between 1-10, 10 being I had nightmares
mezya [45]
5 I don’t think it’s good. I thought it was boring.
4 0
3 years ago
Other questions:
  • Which writing format is also beneficial to public speaking? a. Five paragraph essay c. Conventions b. Prose d. None of these
    5·2 answers
  • The IP address 129.53.82.20 falls under what class of IP addresses??
    5·2 answers
  • The two types of objects responsible for collecting data are
    14·1 answer
  • Higher-speed Ethernet technologies use an electronic device known as a Hub rather than a switch True/False
    15·1 answer
  • Write a function safeOpen() that takes one parameter, filename — a string giving the pathname of the file to be opened for readi
    15·1 answer
  • Rule number one for handling an emergency is to _____. A. buy a new vehicle B. call law enforcement C. remain calm D. restart th
    6·2 answers
  • If a employee has a grade grater than or equal to 18, then he she will get 50% bonous on the basic pay. Otherwise, the employee
    5·1 answer
  • Which best explains a password attached to a document?
    6·2 answers
  • You are developing a Website that is going to be viewed extensively on smartphones and tablets. Which of the following should yo
    7·1 answer
  • Which of these can be a problem for people with accessibility issues? Select 4 options.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!