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
puteri [66]
3 years ago
6

To create a linear linked

Computers and Technology
1 answer:
liq [111]3 years ago
3 0

Answer:

Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort. However, insertion sort provides several advantages:

Simple implementation: Jon Bentley shows a three-line C version, and a five-line optimized version[1]

Efficient for (quite) small data sets, much like other quadratic sorting algorithms

More efficient in practice than most other simple quadratic (i.e., O(n2)) algorithms such as selection sort or bubble sort

Adaptive, i.e., efficient for data sets that are already substantially sorted: the time complexity is O(kn) when each element in the input is no more than k places away from its sorted position

Stable; i.e., does not change the relative order of elements with equal keys

In-place; i.e., only requires a constant amount O(1) of additional memory space

Online; i.e., can sort a list as

You might be interested in
Time Conversion C++: Given a time in -hour AM/PM format, convert it to military (24-hour) time.
mixer [17]

Answer:

Code in C++::

#include<bits/stdc++.h>

#include<iostream>

#include<string>

#include<sstream>

using namespace std;

string timeConversion(string s){

/**

* Following two strings are declared named d and c respectively.

* String c will be storing the converted format time and we will return

* c as the answer.

*/

string d,c="";

/**

* String d stores "PM" or "AM"

*/

d=s.substr(8,2);

/**

* An integer named hr is declared below and it stores

* the hh part of string hh:mm:ssPM in integer format.

*/

int hr=atoi(s.substr(0,2).c_str());

if(hr==12 && d=="AM"){

/**

* Now suppose hr is 12 and its AM then we know that it's

* midnight and so hr must be 0.

*/

hr=0;

}

if(d=="PM" && hr!=12){

/**

* Suppose d is "PM" and hr is not 12 then we add 12 into hr.

*/

hr+=12;

}

if(hr<10){

/**

* Now suppose hr is less then 10 then we know that in final answer

* if hr is 7 then we need "07".

* So if hr < 10 then we add extra 0 at start of c string.

*/

c+="0";

}

/**

* Now we convert hr back to string using stringstream.

* A variable named hour is declared and we convert hr to string as follows.

*/

stringstream hour;

hour<<hr;

/**

* Finally we update the c string as required and return it at the end.

*/

c=c+hour.str()+s.substr(2,6);

return c;

}

int main(){

/**

* A string named s is declared and using cin we scan the string.

*/

string s;

cin>>s;

/**

* Below we call the function and pass string s as parameter.

* Whatever function returns, it is printed.

*/

cout<<timeConversion(s)<<endl;

return 0;

}

Explanation:

see thees attached

8 0
3 years ago
What can Strings store
horsena [70]
A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
5 0
4 years ago
Read 2 more answers
WHAT DO U MEANS BY DIGITAL PROFILE​
max2010maxim [7]

Answer:

l don't know ,am so sorry

6 0
3 years ago
Which osi model layer manages data encryption?
Hoochie [10]
The presentation Layer manages data encryption.
7 0
4 years ago
Teknoloji ile ilgili 5 tane örnek yazabilir misiniz? Lütfen..
kiruha [24]

Answer:

אז מה עוד אני יכול להגיד לך בסדר אני חולה

6 0
3 years ago
Other questions:
  • ​________ establishes a connection between the​ computers, sequences the transfer of​ packets, and acknowledges the packets sent
    11·1 answer
  • WordArt styles allow you to add ____.
    9·1 answer
  • Which us electronic company was the pioneer in home video game consoles?
    13·1 answer
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • What are the similarities between data mining and data analytics
    11·1 answer
  • Which of the following describes an iteration in a computer program?
    8·1 answer
  • Why is myConcerto considered essential to Accenture's work with enterprise<br> systems?
    13·1 answer
  • What accesses organizational databases that track similar issues or questions and automatically generate the details to the repr
    14·1 answer
  • IF YOU WANT NICELY ENGLISH MUSIC ADD MY W.h.a.t.s.A.p.p nomber <br>+60 199094836​
    5·1 answer
  • Who is the monst important person and why
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!