C++ Given an array of integers, sort the array in ascending/descending order by using bubble sort algorithm. Reference:

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

C++ Given an array of integers, sort the array in ascending/descending order by using bubble sort algorithm. Reference:

Post by answerhappygod »

C++
Given an array of integers, sort the array inascending/descending order by using bubble sortalgorithm.
Reference:http://www.algolist.net/Algorithms/Sorting/Bubble_sort
Write a program to accept 3 parameters, an array A ofintegers, size of the array N and sorting order O (0 or1).
Note: 0 represents ascending order. 1 represents descending order.
Input 0 9 4 3 6 8 9 2 1 5 7
Where,
Output 1 2 3 4 5 6 7 8 9
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply