1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ymorist [56]
1 year ago
13

write a function print array to print an array on one line as: 9 8 7 6 5 4 3 2 1 0 write and test a function called bubble sort

that implements this sorting method and call it from your main function. you will need to swap elements to sort the array.
Computers and Technology
1 answer:
Lisa [10]1 year ago
4 0

Function print array to print an array on one line as:

void printArray(int arr[], int n)
{
   int i;
   for (i = 0; i < n; i++)
       printf("%d ", arr[i]);
   printf("\n");
}
void bubbleSort(int arr[], int n)
{
  int i, j;
  for (i = 0; i < n-1; i++)      
      for (j = 0; j < n-i-1; j++)  
          if (arr[j] > arr[j+1])
             swap(&arr[j], &arr[j+1]);
}
void main()
{
   int arr[] = {9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
   int n = sizeof(arr)/sizeof(arr[0]);
   printf("Given array is \n");
   printArray(arr, n);
   bubbleSort(arr, n);
   printf("\nSorted array is \n");

What is array?
An array is a type of data structure used in computer science that contains a set of elements (values and variables), each of which is designated by an array index or key. The simplest type of data structure is indeed a linear array, also known as a one-dimensional array. For instance, an array of ten 32-bit (4-byte) arithmetic operations, to indices 0 through 9, may be stashed as ten words at memory addresses 2000,2004,2008,..., 2036 (in hexadecimal: 0x7D0, 0x7D4, 0x7D8,..., 0x7F4) so that the element with index

To learn more about array
brainly.com/question/24275089
#SPJ4

You might be interested in
PERGUNTA 1
Genrish500 [490]

Answer:hola no conozco el toldo, pero necesito puntos cerebrales tan lo siento

Explanation:

8 0
3 years ago
Diana is running a successful remarketing campaign. She wants to expand her reach with other targeting options. While creating a
mart [117]

Answer:

B: Audience interest around different topics.

Explanation:

When using Google Ads, and the main aim is to create a campaign for a particular marketing activity, there are several options that makes Google Ads the ideal application for this purpose. However, choosing similar audiences under the targeting option is simply telling google to find users or audiences that are interested in the different topics, but are in one way or the other connected to your marketing activity or campaign.

8 0
4 years ago
Create a Python script that takes two parameters to do the following:-
tekilochka [14]

Answer:

import sys, time

from os import walk, remove

from os.path import exists, join, getsize, getctime

file_counter = [ ]

folder_name, file_size = argv

isExist = exists( folder_name )

if folder_name == True:

    for root, folder, files in walk( folder_name ):

          for file in files:

               if getsize( join ( root, file ) ) >= file_size:

                   file_log = [ ]

                   file_log.append( file )

                   file_log.append( join ( root, file) )

                   file_log.append( time.ctime( getctime( file ) ) )

                   file_counter.append( file_log )

               else:

                   remove ( join ( root, file ) )

Explanation:

The python script above output the filename, size and file creation date of any folder passed to it.

6 0
3 years ago
What are the four main content questions that need to be answered for every project you work on?
7nadin3 [17]

Answer: 1. What are the major deliverables ?

2. How will you get those deliverables before or by the deadline ?

3. Who is on the on the team and what role will they play ?

4. When will the team meet milestones on when will other members on the team play a role in. Contributing to or providing feedback on those deliverables ?

3 0
3 years ago
Which of the following is least likely checked by the comprehensive component monitor?
Tcecarenko [31]

Answer:

Least likely checked by the comprehensive component monitor is Opens  

Explanation:

Rationality menas Quality. A quality needs to verified for each and every product that we buy so that it comes life-long and give accurate results all the time.

A short to ground needs to be checked so that it does not gives electrical shock as soon as we touch the component. “Grounding” helps to achieve this.

It is equally necessary  to check for short-to-power so that the power circuit is not damaged due to low-power.

The only irrelevant option is “Opens”.

5 0
3 years ago
Other questions:
  • Design the below using an array// Sunrise Freight charges standard// per-pound shipping prices to the five states they serve// –
    6·1 answer
  • ___ Jacking is a crime that takes place when a hacker misdirects URL to a different site. The Link Itself Looks Safe, But the us
    11·1 answer
  • Look at the following form. Which input method is the form using to receive the user's favorite activity? What is your favorite
    12·2 answers
  • Dit View
    5·2 answers
  • IDE devices require the use of a controller mounted on the motherboard. True False
    14·2 answers
  • Which of the following is a benefit, as well as a risk, associated with peer-to-peer networks?
    6·2 answers
  • Members of the sales team use laptops to connect to the company network. While traveling, they connect their laptops to the inte
    15·1 answer
  • 9.11: Array Expander
    15·1 answer
  • John has recently retired from an administrative, yet technical job which he held for 40 years. He decided to pursue a life-long
    11·1 answer
  • Greg is concerned about the use of ddos attack tools against his organization, so he purchased a mitigation service from his isp
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!