INTERNATIONAL EDITION---Numerical Methods for Engineers, 7th edition
INTERNATIONAL EDITION---Numerical Methods for Engineers, 7th edition
7th Edition
ISBN: 9781259170546
Author: Steven Chapra and Raymond Canale
Publisher: MCG
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 murder scene is found with two types of blood - that of the victim and that ofthe murderer. As luck would have it, the unidentified blood has an incredibly rareblood disorder, only found in 1 in every million men. The capital and surroundingareas have a population of 20 million - and the police are sure the murderer isfrom the capital. The police have already started cataloging all citizens' bloodtypes for their new super crime-database. They already have nearly 1 millionmale samples in there - and bingo - one man, Mr XY, is a match. He is promptlymarched off to trial, there is no other evidence, but the jury are told that the oddsare 1 in a million that he is innocent. He is duly convicted. The question is, howlikely is it that he did not commit this crime?
Suppose Albers Elementary School has 23 teachers and Bothel Elementary School has 38 teachers. If 17 teachers teach at both Albers and Bothel, compute the total number of teachers employed at Albers and Bothel combined.
John Allen Paulos has pointed out a problem with massive, untargeted wiretaps. To illustrate the problem, he sup-poses that one out of every million Americans has terrorist ties. Furthermore, he supposes that the terrorist profile is 99% accu-rate, so that if a person has terrorist ties, the profile will pick them up 99% of the time, and if the person does not have ter-rorist ties, the profile will accidentally pick them up only 1% of the time. Given that the profile has picked up a person, what is the probability that the person actually has terrorist ties? Dis-cuss how your answer affects your opinion on domestic wire-tapping. Source: Who’s Counting.

Chapter 2 Solutions

INTERNATIONAL EDITION---Numerical Methods for Engineers, 7th edition

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
Recommended textbooks for you
Text book image
Linear Algebra: A Modern Introduction
Algebra
ISBN:9781285463247
Author:David Poole
Publisher:Cengage Learning
Text book image
Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell
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