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
-
Assume that payroll records of a branch of Indigo Books provided the following information for the weekly pay period ended December 18, 2015: Lucy Bourdon and Maurice Lamont work in the office, and...
-
Fawcett Institute provides one-on-one training to individuals who pay tuition directly to the business and also offers extension training to groups in off-site locations. Fawcett prepares adjusting...
-
During your audit of Lish and Company's December 31, 1998 financial statements, you become aware of the following controls or procedures Lish has implemented over credit sales and cash collections:...
-
Nordstrom, Inc. operates department stores in numerous states. Selected financial statement data for the year ending February 2, 2008, are shown on the next page. For the year, net sales were $8,828,...
-
Halifax Manufacturing allows its customers to return merchandise for any reason up to 90 days after delivery and receive a credit to their accounts. All of Halifax's sales are for credit (no cash is...
-
Create common size income statements and perform a basic ratio analysis of the two companies for fiscal year 2021, which is the fiscal year ended on Jan. 29, 2022/Jan. 28, 2022. (Note: fiscal year...
-
20) If you owed $1,000 on your credit card on 9/1/17, and paid $500 on 9/16/17, what is your Average Daily Balance on your credit card for the month of September (9/1- 9/30/17) ?
-
below. Oxx Determine the Kolosov-Muskhelishvili potentials for a state of uniform uniaxial stress, Oxx = S, perturbed by the presence of a traction-free circular hole of radius a as illustrated y Oxx...
-
Mr.X is a Filipino mixed income earner. He is a minimum wage earner in ABC Corporation working as a Security Guard. On the other hand he has various business interests other than his minimum wage....
-
Assignment 2 $200,000. Its taxable capital employed in Canada was $350,000 as at December 31, 2019, and $365,000 as at December 31, 2020.
-
There is a society of seven individuals, 1,2,3,4,5,6,7), who are connected in a social network as below. If there is a link between two individuals, then that pair of individuals are friends. If...
-
(Dataset: NES. Variables: who_2016, better_worse_past_econ, [aw=nesw.) what factors determine how people vote in presidential elections? Political scientists have investigated and debated this...
-
QUESTION 1 a) Show that x = sin(Int) is a solution of the following differential equation (i.e. LHS=RHS). t2dx dt dx +t+ x = 0 dt (5) b) The streamlines of a fluid are given by dy dx Solve the...
-
In the current year, the City of Omaha donates land worth $500,000 to Ace Corporation to induce it to locate in Omaha and create an estimated 2,000 jobs for its citizens. a. How much income, if any,...
-
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 how objects interact by exchanging messages.
-
Describe the relationship between dynamic modeling, behavioral modeling, and structural modeling.
-
Comment on this statement: Dynamic modeling is about interaction.
Study smarter with the SolutionInn App