Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ... , An, Bubble Sort repeats the BubbleMax step until no swaps happen during Bubble Max. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement. Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ..., An, Bubble Sort repeats the BubbleMax step until no swaps happen during Bubble Max. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement. Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ..., An, Bubble Sort repeats the BubbleMax step until no swaps happen during BubbleMax. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement. Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ... , An, Bubble Sort repeats the BubbleMax step until no swaps happen during Bubble Max. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement. Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ..., An, Bubble Sort repeats the BubbleMax step until no swaps happen during Bubble Max. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement. Problem 1 (5pnts): Design and write in pseudocode an algorithm called SwapNumbers. Given two numbers that are stored in two different variables, the algorithm swaps them. Example: Given a = 6 and b = 20, after executing the algorithm, a should be 20 and b should be 6. Problem 2 (5pnts): Design and write in pseudocode an algorithm called BubbleMax. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, An, the algorithm starts at the first number compares it with the number that follows and if the first number is larger swaps them. It repeats the same process till it reaches the second to last number. After the algorithm terminates An has the largest number in the list. Problem 3 (10pnts): Write the Bubble Sort algorithm in pseudocode. Use the top-down stepwise refinement technique to design and express your algorithm. Use the BubbleMax algorithm from problem 2 as a building-block algorithm. Given a value n ≥ 1 and a list containing exactly n numbers called A₁, A2, ..., An, Bubble Sort repeats the BubbleMax step until no swaps happen during BubbleMax. At this point the list is sorted. What to submit: Submit a report that includes a detailed description in pseudocode for the algorithms of problems 1 and 2 and at least 3 different pseudocode versions of the Bubble Sort algorithm. The different versions of the Bubble Sort algorithm should reflect the steps of the top-down stepwise refinement. Thise means that the second version should be derived from the first with the refinement of one or more algorithm statements, similarly the third should be derived from the second the refinement of one or more statements. The last pseudocode version of the Bubble Sort algorithm should be fully developed - no statements need further refinement.
Expert Answer:
Answer rating: 100% (QA)
Ill provide pseudocode for each problem as described Problem 1 SwapNumbers Algorithm SwapNumbersa b ... View the full answer
Related Book For
Holt McDougal Larson Geometry
ISBN: 9780547315171
1st Edition
Authors: Ron Larson, Laurie Boswell, Timothy D. Kanold, Lee Stiff
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Write a paper on Health-Care Fraud
-
Find the z-score such that the area under the standard normal curve to its right is 0.25. Find the indicated z-score. Be sure to draw a standard normal curve that depicts the solution.
-
Write the augmented matrix of the given system of equations. 2 + 3 6 %3D 0 4 + 2%3D 0
-
Plaintiff visited South Chicago on January 10, 2008, seeking a new 2008 Nissan Versa (Versa) with manual transmission, anti-lock brakes, and other features. He was told by the employees of South...
-
Morrisey & Brown, Ltd., of Sydney is a merchandising company that is the sole distributor of a product that is increasing in popularity among Australian consumers. The companys income statements for...
-
Hybrid agreements (also called wait-and-see agreements), which usually allow the issuer first priority to buy the interest and other stockholders or partners the second-place option to buy. Such...
-
Write proposal about the topic below and should be about SAUDIA ARABIA health system only. The proposal has to be on WORD format and should include, a. Introduction b. Literature review c. Aim of the...
-
Commercial Roofing Company purchases inventory of $64,500. The freight cost is $700. Its supplier uses the FOB destination method. Calculate the total cost of purchasing the inventory to Commercial...
-
Hat is a key feature in computing your FICO score? What is a key feature in computing your FICO score? Debt Your annual gross income How much money you have in savings?
-
A public traded company has a debt-equity ratio of 0.6 .Its cost of debt after tax is 7% and cost of equity is 11%. What the cost of equity for the company would be if its target capital structure...
-
True Steel's management has set up an internal risk management policy/system. One part of this system addresses the inputting of data into the software programs used in the accounting department....
-
Prior to the 1986 Tax Reform Act, taxpayers could average their in- come over multiple years when calculating each year's tax liability; this option was eliminated by the TRA. How does this violate...
-
The standard quantity and standard price of raw material required for one unit of product a are given as follows quantity (kg.) s.p. (ksh`) material x material y 2 4 3 2 the actual production and...
-
In a certain school district, 3% of the faculty use none of their sick days in a school year. Find the probability that 5 faculty members selected at random used no sick days in a given year.
-
Determine whether ABC DEF. If they are congruent, write a congruence statement. Explain your reasoning. A 5 4 D 1 E C B 1 5 4 F
-
Find the area of the figure. y 1 X
-
Use the Distance Formula to decide whether AB AC. A(-3,0), B(2, 2), C(2,-2)
-
Explain why the business objectives of owners and managers are likely to diverge. How might owners attempt to ensure that managers act in their interests and not in the managers own interests?
-
1. In what ways did the defence industries respond to the ending of the Cold War? 2. Using an Internet search, find out how the defence and security industries have responded to the threat of...
-
What is the Standard Industrial Classification (SIC)? In what ways might such a classification system be useful? Can you think of any limitations or problems such a system might have over time?
Study smarter with the SolutionInn App