Explain the code BUBBLE SORTING IN ASCENDING ORDER OF THE ELEMENTS OF A USER-SUPPLIED 1D ARRAY SOURCE
Fantastic news! We've Found the answer you've been seeking!
Question:
Explain the code
Transcribed Image Text:
BUBBLE SORTING IN ASCENDING ORDER OF THE ELEMENTS OF A USER-SUPPLIED 1D ARRAY SOURCE CODE: #include<stdio.h> #define site 100 void bubble sort (int[], int num) void main() ( int xlsise), num, 17 printf("\nEnter no of elements t "17 scant a("%d", anun) printf("\nEnter array elements 1 for 150: 1 num 1++) { scanf ("d", []); 1 bubble sort (x, m); void bubble sort (int yll, int num) ( int 1, 3. k. temp/ printf("\nsorted Data: for 10: kuk) ( printf("45d", ylk]); 3 for (111<num++ ( for 13-03-1/3++ LE (y(31 y 331 teap- y13) Yis1- yis 31 y1511-temp/ 1 "11 printf("\nArter pass td, 19 for ( 0; <**) ( print("134", y(k) 1 printf("\n") There are a number of Unsorted Elements Total Mumber of Iterations-1 At the End of First IterationLargest Element Will get its Exact Pinal Position at the End of Ind Iteration 2nd Largest sinners will get its Exact Final Position 4 At the End of (N-11es Iteration 1-31th Largest Element will get its Exact rinal Position XE e BUBBLE SORTING IN ASCENDING ORDER OF THE ELEMENTS OF A USER-SUPPLIED 1D ARRAY SOURCE CODE: #include<stdio.h> #define site 100 void bubble sort (int[], int num) void main() ( int xlsise), num, 17 printf("\nEnter no of elements t "17 scant a("%d", anun) printf("\nEnter array elements 1 for 150: 1 num 1++) { scanf ("d", []); 1 bubble sort (x, m); void bubble sort (int yll, int num) ( int 1, 3. k. temp/ printf("\nsorted Data: for 10: kuk) ( printf("45d", ylk]); 3 for (111<num++ ( for 13-03-1/3++ LE (y(31 y 331 teap- y13) Yis1- yis 31 y1511-temp/ 1 "11 printf("\nArter pass td, 19 for ( 0; <**) ( print("134", y(k) 1 printf("\n") There are a number of Unsorted Elements Total Mumber of Iterations-1 At the End of First IterationLargest Element Will get its Exact Pinal Position at the End of Ind Iteration 2nd Largest sinners will get its Exact Final Position 4 At the End of (N-11es Iteration 1-31th Largest Element will get its Exact rinal Position XE e
Expert Answer:
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Suppose that the correct model for estimating a given relationship is: E[Y|D, X] = Bo + B1 Di + BX; + VD However, instead of estimating the above regression, we estimate the model below: E[Y|D] = bo...
-
At year-end, December 31, 2014, Corolla Sales showed unadjusted balances of: $394,000 in Accounts Receivable; $13,800 debit in Allowance for Doubtful Accounts; and $1,940,000 in Sales. Uncollectible...
-
a. , b, c, d, ? UNIQUE OFFERS WORLD LTD You are in the assurance team of BEST-CPA, a Certified Public Accounting firm. BEST-CPA has been engaged to provide consultancy with respect to accounting...
-
For each of the statements, state the null and alternative hypotheses The average age of taxi drivers in New York City is 36.3years. The average IQ of disc jockeys is greater than 117.3. The average...
-
Visit Digg, Delicious, and Quora. Prepare a report or presentation to the class that explains the site, which social media characteristics are evident, and what personal or business process the site...
-
A chimpanzee stacks a series of boxes on top of one another to reach a bunch of bananas suspended from the ceiling. This is an example of which of the following behaviors? (A) Operant learning (B)...
-
If grandfathering is accepted as the basis for allocating initial emission permits what is the likely impact on early action (action before trading schemes commence) being taken to reduce emissions?...
-
As a manager employed by Want-It-Now Rapid Delivery Service, you are responsible for pricing the services involving same-day deliveries. Among your primary concerns is the competitive aspects of your...
-
On April 2, a corporation purchased for cash 6,000 shares of its own $14 par common stock at $29 per share. It sold 4,000 of the treasur per share. a. Journalize the entry for the purchase (treasury...
-
Ellipses Corp is a small business that operates in Herndon, VA. The company is located at10 Period Lane, Herndon, VA 20170. Its federal Employer Identification Number is 77-7777777, and its...
-
Let f= u + iv be a continuous function and y(t) = x(t) + iy(t) be a piecewise smooth curve. Show that Re{f, f(z) dz} = f (u dx - v dy and Im {f, f(z) dz} = [ (v dx + u dy). Here, dx = x'(t) dt, dy =...
-
Indicate the possible effects on the auditor's report of a departure from (a) a promulgated principle and (b) a GAAP.
-
Find the z-score for which the area to its right is 0.14.
-
If X is a continuous random variable, then P(X = a) = ___________________ for any number a. In Exercises 914, fill in each blank with the appropriate word or phrase.
-
What observation techniques does Strategy Analytics (www.strategyanalytics.com) utilize for its AppOptix service and how does it operate? What industry does it potentially serve?
-
Find the z-score for which the area to its right is 0.84.
-
If a pixel is the basic building A Shock-mount is used with a microphone to aid is isolating the mic from: Question 3 options: Unwanted reflections Wind noise Environmental noise Mechanical/handling...
-
MgO prevents premature evaporation of Al in a furnace by maintaining the aluminum as Al2O3. Another type of matrix modifier prevents loss of signal from the atom X that readily forms the molecular...
-
1. Refer to the information for Cox Inc. above. What amount would Cox record as depreciation expense for 2019 if the units-of-production method were used (Round your answer to the nearest dollar)? a....
-
Shortly after July 31, Towanda Corporation received a bank statement containing the following information: July cash transactions and balances on Towandas records are shown in the following...
-
On January 1, 2020, Benton Corporation borrowed $1,000,000 with 10-year, 8.75% notes, interest payable semiannually on June 30 and December 31. Cash in the amount of $985,500 was received when the...
-
When an auditor is asked to perform a broad management study, what should be the content of the first presentation to management? '
-
What are indicators? What would be an indicator of the amount of receipts a hotel should report?
-
What principles of internal control are violated in a company where the bookkeeper deposits receipts, the buyer doubles as accounts payable clerk, and the inventory clerk authorizes inventory write...
Study smarter with the SolutionInn App