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
RUDIKE [14]
3 years ago
10

Write a C++ program that usesInsertion Sort to sort an unsorted list of numbers.

Computers and Technology
1 answer:
andrew11 [14]3 years ago
5 0

<u>C++ program - Insertion sort</u>

<u></u>

#include <bits/stdc++.h>  

using namespace std;  

/* Defining function for sorting numbers*/

void insertionSort(int array[], int n)  

{  

   int i, k, a;  

  for(i=1;i<n;i++)

           {

              k=array[i];

               a=i-1;

            while(a>=0 && array[a] > k) // moving elements of array[0 to i-1] are greater than k, to one position //

                      {

                       array[a+1] = array[a];

                        a =a-1;

                      }

              array[a+1] =k;

             }  

}              

/* Driver function */

int main()  

{  

   int array[] = { 12,56,76,43,21};   //input integers

   int n = sizeof(array) / sizeof(array[0]);   //finding size of array

 

   insertionSort(array, n);   //Calling function

    for (int i = 0; i < n; i++)   //printing sorted array

        cout << array[i] << " ";  

    cout << endl;  

    return 0;  

}  

You might be interested in
What does a cascading style sheet resolve a conflict over rules for an element?
Margaret [11]
I Think The answer is d I hope it helps
4 0
3 years ago
_______ refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when
ludmilkaskok [199]

Geofencing Marketing refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when a mobile device enters or leaves a particular area.

<h3>What is Geofencing Marketing?</h3>
  • Geofencing marketing is an illustration of a real-time location-based trade tactic that utilizes geolocation data to mark users within a specified geographic region and delivers a range based on where they are or in what areas they have previously visited.
  • Geofencing marketing concerns setting up virtual borders around a point or area that tracks whenever someone with a portable device crosses them.

To learn more about Geofencing Marketing, refer:

brainly.com/question/9795929

#SPJ4

4 0
1 year ago
Pathways in the Science, Technology, Engineering, &amp; Mathematics Career Cluster include:
ZanzabumX [31]

Answer: wanna say engineering technology and science and mathematics

Explanation:

7 0
3 years ago
The =COUNT function calculates what value?
Natalka [10]

c is the anwer of question

4 0
3 years ago
Read 2 more answers
Please I want help on this question <br>I want the answer quickly because I have test<br>​
Nikitich [7]

Answer:

RIGHT 90

PENDOWN

REPEAT 6

FORWARD 100

LEFT 60

END REPEAT

Explanation:

I hope this helps a little bit.

5 0
3 years ago
Other questions:
  • Dr. Joon asks her students how to insert a table in an Excel workbook. The students record the steps a chart. Which students lis
    15·1 answer
  • What device brocasts all data packets to other nodes on a network?
    5·1 answer
  • How is a computer component, such as a network card, commonly marked for identification?
    12·1 answer
  • I want to discard my old computer and securely erase the data from my hard drive.
    12·1 answer
  • In what way are a coffee maker and a dishwasher the same?<br><br>BY THE WAY THIS IS TEENBIZ
    9·2 answers
  • How many pounds must a sand bag weigh to test if a safety net can absorb the proper amount of force? A. 150 lbs. B. 200 lbs. C.
    6·1 answer
  • Which of the following can spreadsheet programs help a person with? (choose all that apply.)
    9·1 answer
  • Cine stie repede va rog mult si repede
    9·1 answer
  • Help i need 76 more points to rank up can some one nice get me those? please please please
    13·2 answers
  • ¿Qué diferencia existe entre un virus biológico y virus informático?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!