Numerical Methods for Engineers
Numerical Methods for Engineers
7th Edition
ISBN: 9780073397924
Author: Steven C. Chapra Dr., Raymond P. Canale
Publisher: McGraw-Hill Education
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 12P

The bubble sort is an inefficient, but easy-to-program, sorting technique. The idea behind the sort is to move down through an array comparing adjacent pairs and swapping the values if they are out of order. For this method to sort the array completely, it may need to pass through it many times. As the passes proceed for an ascending-order sort, the smaller elements in the array appear to rise toward the top like bubbles. Eventually, there will be a pass through the array where no swaps are required. Then, the array is sorted. After the first pass, the largest value in the array drops directly to the bottom. Consequently, the second pass only has to proceed to the second-to-last value, and so on. Develop a program to set up an array of 20 random numbers and sort them in ascending order with the bubble sort (Fig. P2.12).

Chapter 2, Problem 12P, 2.12	The bubble sort is an inefficient, but easy-to-program, sorting technique. The idea behind the

FIGURE P2.12

Blurred answer
Students have asked these similar questions
A family has two cars. The first car has a fuel efficiency of 16 kilometers per liter of gas and the second has a fuel efficiency of 18 kilometers per liter of gas. During one particular week, the two cars went a combined total of 3150 kilometers, for a total gas consumption of 190 liters. How many liters were consumed by each of the two cars that week? Note that the ALEKS graphing calculator can be used to make computations easier. First car: liters ? Second car:|liters
The Royal Fruit Company produces two types of fruit drinks. The first type is 65% pure fruit juice, and the second type is 90% pure fruit juice. The company is attempting to produce a fruit drink that contains 75% pure fruit juice. How many pints of each of the two existing types of drink must be used to make 80 pints of a mixture that is 75% pure fruit juice? Note that the ALEKS graphing calculator can be used to make computations easier. First fruit drink: M pints ? Second fruit drink: pints
The Royal Fruit Company produces two types of fruit drinks. The first type is 30% pure fruit juice, and the second type is 55% pure fruit juice. The company is attempting to produce a fruit drink that contains 40% pure fruit juice. How many pints of each of the two existing types of drink must be used to make 80 pints of a mixture that is 40% pure fruit juice? Note that the ALEKS graphing calculator can be used to make computations easier. First fruit drink: Il pints ? Second fruit drink: pints Submit Assignment Continue 7071 MCGroHill Education Al Rights Reserved. Terms of Use Privacy Accessibility

Chapter 2 Solutions

Numerical Methods for Engineers

Knowledge Booster
Background pattern image
Advanced Math
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:Cengage Learning
Text book image
Elementary Linear Algebra (MindTap Course List)
Algebra
ISBN:9781305658004
Author:Ron Larson
Publisher:Cengage Learning
12. Searching and Sorting; Author: MIT OpenCourseWare;https://www.youtube.com/watch?v=6LOwPhPDwVc;License: Standard YouTube License, CC-BY
Algorithms and Data Structures - Full Course for Beginners from Treehouse; Author: freeCodeCamp.org;https://www.youtube.com/watch?v=8hly31xKli0;License: Standard Youtube License