Use the bubble sort to sort d, f, k, m, a, b, showing the

Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen

Problem 36E Chapter 3.1

Discrete Mathematics and Its Applications | 7th Edition

  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen

Discrete Mathematics and Its Applications | 7th Edition

4 5 0 250 Reviews
16
3
Problem 36E

Use the bubble sort to sort d, f, k, m, a, b, showing the lists obtained at each step.

Step-by-Step Solution:

SolutionStep 1In this problem, we have to sort the list using the bubble sort technique.The list is given by d, f, k, m, a, bSo, we have to use the ascii value of d, f, k, m, a, bAscii Value of d = 100Ascii Value of f = 102Ascii Value of k = 107Ascii Value of m = 109Ascii Value of a = 97Ascii Value of b = 98Step 2First Phase(100, 102, 107, 109, 97, 98 ) (100, 102, 107, 109, 97, 98 ) Compare the next two elements in the given list (100 > 102).So, the condition is false.(100, 102, 107, 109, 97, 98 ) (100, 102, 107, 109, 97, 98 )Compare the next two elements in the given list (102 > 107).So, the condition is false.(100, 102, 107, 109, 97, 98 ) (100, 102, 107, 109, 97, 98 )Compare the next two elements in the given list (107 > 109).So, the condition is false.(100, 102, 107, 109, 97, 98 ) (100, 102, 107, 97, 109, 98 )Here, It compares the first two elements in the given list and swap since 109 > 97(100, 102, 107, 97, 109, 98 ) (100, 102, 107, 97, 98, 109 )Here, It compares the first two elements in the given list and swap since 109 > 97Step 3Second Phase(100, 102, 107, 97, 98, 109 ) (100, 102, 107, 97, 98, 109 )Compare the next two elements in the given list (100 > 102).So, the condition is false.(100, 102, 107, 97, 98, 109 ) (100, 102, 107, 97, 98, 109 )Compare the next two elements in the given list (102 > 107).So, the condition is false.(100, 102, 107, 97, 98, 109 ) (100, 102, 97, 107, 98, 109 )So, it compares the next two elements in the given list and swap since 107 > 97(100, 102, 97, 107, 98, 109 ) (100, 102, 97, 98, 107, 109 )So, it compares the next two elements in the given list and swap since 107 > 98(100, 102, 97, 98, 107, 109 ) (100, 102, 97, 98, 107, 109 )Compare...

Step 2 of 3

Chapter 3.1, Problem 36E is Solved
Step 3 of 3

Textbook: Discrete Mathematics and Its Applications
Edition: 7th
Author: Kenneth Rosen
ISBN: 9780073383095

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

Use the bubble sort to sort d, f, k, m, a, b, showing the

×
Log in to StudySoup
Get Full Access to Discrete Mathematics And Its Applications - 7th Edition - Chapter 3.1 - Problem 36e

Forgot password? Reset password here

Join StudySoup for FREE
Get Full Access to Discrete Mathematics And Its Applications - 7th Edition - Chapter 3.1 - Problem 36e
Join with Email
Already have an account? Login here
Reset your password

I don't want to reset my password

Need help? Contact support

Need an Account? Is not associated with an account
Sign up
We're here to help

Having trouble accessing your account? Let us help you, contact support at +1(510) 944-1054 or support@studysoup.com

Got it, thanks!
Password Reset Request Sent An email has been sent to the email address associated to your account. Follow the link in the email to reset your password. If you're having trouble finding our email please check your spam folder
Got it, thanks!
Already have an Account? Is already in use
Log in
Incorrect Password The password used to log in with this account is incorrect
Try Again

Forgot password? Reset it here