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
maria [59]
3 years ago
14

Write the pseudocode for linear search, which scans through the sequence, looking for ν. Using a loop invariant, prove that your

algorithm is correct. Make sure that your loop invariant fulfills the three necessary properties.
Computers and Technology
1 answer:
zavuch27 [327]3 years ago
8 0

Answer:

1 for i = 1 to A.length

2 if A[i] = nu

3 return i

4 return NIL

Explanation:

Loop invariant:

At the start of each iteration of the for loop of lines 1-3, there is no j<i such that A[j]=ν.

Initialization:

At the beginning of the first iteration, we have i=1, so there is no j<i such that A[j]=ν.

Maintenance:

We fix i and assume there is no j<i such that A[j]=ν.

If A[i]=ν, then we return a value, so then there are no more iterations, so the property is preserved.

If A[i]≠ν, then there is no j<i+1 such that A[j]=ν, which is the desired property for the next step.

Termination:

The loop terminates either for i=A.length+1, or if ever we encounter A[i]=ν.

In the first case, then there is no 1≤j≤A.length such that A[j]=ν, and we are correctly returning NIL

In the second case, if we encounter some i such that A[i]=ν, we are correctly returning i.

You might be interested in
Directions Use your imagination and a word processor to write a business letter with two to three paragraphs. Your business lett
Citrus2011 [14]

Eric N. Marcus

Marcus Production Company

3 Turner Avenue

Monsey, NY 10952

    I am writing to recommend Stacie Allen; Stacie is a very hard-working individual she's dedicated to her work and always wants to help others out. She accomplished many things while at Toms shoes.  

    Stacie dedicates all her time to her job and cares about everyone's wellbeing and happiness and is always there to pick people up. She has accomplished so many things and helps her company come up with ideas and better ways for us to do things.  

  I believe she would be great for this company,  

3 0
3 years ago
Which cable would you check if you can't access any web pages?
ozzi

Answer:

If You Can't Access the Web

We'll assume that your Internet was working at an earlier point. If you are setting it up for the first time, the steps listed below were not designed with that purpose in mind. You need to follow the instructions that came with your router or modem.

I've included a series of definitions for the terminology used on this page.

Reboot the Computer

The first step should be rebooting your computer or device to see if that fixes the problem. You'd be surprised how often that simple step resolves issues.

If restarting your computer or device doesn't work, you'll have to check out each potential problem area to see if it restores access.

Check These Areas

The most likely problem areas related to a loss of Internet assess are one or more of the following:

your computer is disconnected from the network (check the network settings;

a proxy has been added to your browser or operating system;

your high-speed modem and/or router needs resetting or is disconnected;

a disconnected network cable (if your computer is wired);

your computer needs to reboot;

your firewall or security software is misconfigured; or

Your software is misconfigured for access to the Internet.

Progress through the suggestions on this page to test alternative solutions. I've presented them in the order I'd likely progress if I were to be assessing the problem and looking for solutions.

ISP Issues

If the issue is with your ISP or (rarely) a regional access issue, the resolution is beyond your control. You'll just have to wait for your ISP or the Internet structure to repair the problem.

5 0
3 years ago
Your new home has a vacuum system. what kind of computer is controlling it?
Scrat [10]
The answer is embedded computer. It is a PC framework with a committed capacity inside a bigger mechanical or electrical framework, frequently with ongoing figuring constraints. It is implanted as a component of a total gadget regularly including equipment and mechanical parts. Installed frameworks control numerous gadgets in like manner utilize today.
6 0
3 years ago
Disconnecting or making the equipment safe involves the removal of all energy sources and is known as _____________. A) Isolatio
Ray Of Light [21]

Isolation. Also is known as Lockout-Tagout. I hope this helps.

5 0
3 years ago
Read 2 more answers
Candy Kane Cosmetics (CKC) produces Leslie Perfume, which requires chemicals and labor. Two production processes are available:
Vilka [71]

Answer:

  1. Divide the resources into three parts using the corresponding process 1, process 1, and process 2 formats to maximize the use of the resources.
  2. Get the expected revenue by calculating the product of the total perfume in ounce and the price of an ounce of perfume.
  3. Increase the advertisement hours of the product.
  4. subtract the advert fee from the generated revenue to get the actual revenue.
  5. subtract the cost of production from the actual revenue to get the actual profit.

Explanation:

The get maximum profit, all the resources must be exhausted in production. The labor is divided into a ratio of 1:1:2 ( which is 5000, 5000, 1000), while the chemical units are in the ratio of 2:2:3 (10000,10000,15000). This would produce in each individual processes; 15000, 15000 and 25000 oz, which is a total of 55000 oz of perfume.

The expected revenue is $275000. If 1000oz from the 55000oz of perfume is sold without advertisement, model Jenny's awareness of the perfume increases the demand by 200oz per hour, therefore, 24hours would field 4800oz demanded, which would only take 270 hours to distribute all remaining perfumes.

The cost of production would be $130000 for labor and chemical resources plus the advert cost of $27000 ( 270 hours by 100) which is a total cost of $157000. The actual profit is $118000 ( $275000 - $157000).

3 0
3 years ago
Other questions:
  • True or false: when considering data backups, it is most important to verify that the integrity of the backup file or data is va
    9·1 answer
  • What is the role of the osi application layer? provides control of all the data flowing between the source and destination devic
    5·1 answer
  • 4. An advantage presented by straight-in spaces is that
    12·1 answer
  • People are able to predict future events to some extent because: (Select all that apply)
    11·1 answer
  • How do you turn on the Track Changes feature in a word-processing document?
    12·1 answer
  • What is "the last mile of broadband access"? Why is this a problem and what kind of impact does it have on the business world an
    9·1 answer
  • Need answer ASAP. I’ll mark brainliest if correct
    7·1 answer
  • Where can formatting features be found ?! Need help asp !‍♀️
    9·1 answer
  • How do people decide their ethical behavior
    13·2 answers
  • This method of file transfer has been used for decades and is frequently used for uploading changes to a website hosted by an in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!