answersLogoWhite

0


Best Answer

In C++ you can use the standard library sort algorithm to sort any data sequence provided the elements support the appropriate comparison operator (std::less<T> for any given type T is used by default).

For example:

std::vector<int> v {5, 9, 7, 1, 3};

std::sort (v.begin(), v.end()); // v = {1, 3, 5, 7, 9}

std::sort (v.begin(), v.end(), std::greater<int>); // v = {9, 7, 5, 3, 1}

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can we write a program which orders the elements of a board given there language of programming c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

C language arrange 10 numbers in descending orders and find one of them using baniry search method?

Arranging 10 numbers in descending orders using C programming language and finding one of them using binary search method is as below: #include void main () { int i,j,a,n,number[30]; printf ("Enter the value of Nn"); scanf ("%d", &amp;n); printf ("Enter the numbers n"); for (i=0; i


On which machine was the first programming language developed?

The first programming language was machine code, the native language of the machine. Every machine type has its own version of machine code but we can trace the earliest example of machine code back to the days of the semi-automatic weaving loom invented by Basile Bouchon in 1725. Strictly-speaking, machine code is not a programming language. Programming languages are human languages, a means of producing machine code through symbolic abstractions that are much easier for humans to interpret than native machine code. It should also be noted that programming languages are never developed on a machine, the language is purely abstract and designed according to a specified proposals. The only thing that is actually developed on the machine is the implementation of the machine code program that physically converts the symbolic instruction code into the machine's own native machine code. Before we had any programming languages, all programs had to be written in the machine's own native machine code. Once we had one programming language, we could use it to create translators for other languages and indeed for other machines besides the one on which it executed. Note that it's difficult to know precisely when programming languages were first used because there were many language pioneers working simultaneously, often sharing ideas and evolving designs to the point that it is difficult to determine at what point a language is "fit for human consumption", so to speak. To make matters worse, many early programming languages were proposed but never designed, while others were designed but never implemented. Assembly language is the next step up from machine code. Like machine code, every machine type has its own version of assembly language, and is therefore a low-level language. Unlike machine code, code written in assembly language has to be translated into native machine code before it can be executed because machine code is the one and only language "understood" by the machine. Converting from assembly language to machine code is as tedious and as error prone as writing the machine code itself, however the actual conversion process is trivial enough that we can easily write a small machine code program (known as an assembler) to perform the conversion for us. The earliest known usage of an assembly language dates from 1949 on the EDSAC computer at Cambridge University, where the assembler (known as Initial Orders) was implemented in read-only memory. The inventors were Maurice Wilkes and W. Renwick. High-level languages are more abstract than assembly languages and are generally more portable (not machine dependent). The first high-level programming language was probably Autocode in 1952 on the Mark I computer at the University of Manchester, or Short Code in the same year on the UNIVAC 1. Short Code was based upon an earlier implementation known as Brief Code in 1949 for the BINAC computer, but it was never tested or debugged. Autocode used a compiler program to convert the high-level symbolic code into machine code whereas Short Code used an interpretation program. The difference between the two is that the native machine code produced by a compiler can be stored and executed without any further translation whereas code written in an interpreted language has to be converted by the interpreter program every time it is executed. As a result, compiled programs perform better than interpreted programs. Modern-day Java is an example of a programming language that is both compiled and interpreted. Unlike a traditional compiler, the Java compiler produces byte code which can then be interpreted to produce native machine code. The reason for this multi-conversion is that the same byte code can be executed upon any machine with a Java virtual machine implementation. That is, the byte code is the native language of the virtual machine and is much quicker to interpret than the higher-level source code would be. It also ensures that the intellectual property -- the source code itself -- is not revealed to the user. It is worth noting that Plankalk&uuml;l was designed from 1943 to 1945 for the Z3 and therefore predates assembly language as well as Autocode and Short Code. However it was not actually implemented until 1998, more than 50 years after it was designed!


How many types or orders of levers are there?

4


What is ASi module?

Automatic Switch Interface (ASI)The CAIRS OSS ASI module is a multiple switching platform provisioning tool that increases the power and accuracy of the CAIRS system substantially. Working in either a single or multiple switch environment, the ASI module is a cross platform scripting language that can communicate to any switch that utilizes ASCII, Binary, XML file configuration commands (i.e. Nortel, Avaya, Lucent, Siemens & Redcom). Although the ASI module carries the complexities of a programming language, all of the hard work is done behind the scenes. When CAIRS users open a work order that requires a switch assignment, CAIRS writes a change request to the ASI sub-folder in the CAIRS database. Watching the CAIRS database real time for new work orders requests, the ASI module interprets each new work order to determine the assignment type. Once the ASI module has successfully programmed the switch it returns an assignment summary to the CAIRS users. The assignment summary notifies the CAIRS user that the assignment has been completed successfully.


What is 'copa' in computer language?

COPA is a technique used by SAP software company to extract data from its database. CO mean controlling and PA means Profit Analysis. Profitability Analysis (CO-PA) enables you to evaluate market segments, which can be classified according to products, customers, orders or any combination of these, or strategic business units, such as sales organizations or business areas, with respect to your company's profit or contribution margin.

Related questions

Why algorithm needs to solve programming problem?

This is the definition of an algorithm - a list of orders of how to solve a given programming problem.


Project execution planning does not include which of these elements?

issuing purchase orders


C language arrange 10 numbers in descending orders and find one of them using baniry search method?

Arranging 10 numbers in descending orders using C programming language and finding one of them using binary search method is as below: #include void main () { int i,j,a,n,number[30]; printf ("Enter the value of Nn"); scanf ("%d", &amp;n); printf ("Enter the numbers n"); for (i=0; i


Project excuton planning dose not include which of there elements?

issuing purchase orders


Project execution planning dose not include which of these elements?

issuing purchase orders


How could one find the opinion of material suppliers concerning the often restrictive language used in the purchase orders created by general contractors and what can be done about such language?

To find out what the opinions of material suppliers are, you could call or visit material suppliers to ask them. There is probably little that can be done about restrictive language used in purchase orders, but it could depend on what the specific language is. Material suppliers might be able to refuse to sell to contractors who have restrictive language in their purchase orders.


On which machine was the first programming language developed?

The first programming language was machine code, the native language of the machine. Every machine type has its own version of machine code but we can trace the earliest example of machine code back to the days of the semi-automatic weaving loom invented by Basile Bouchon in 1725. Strictly-speaking, machine code is not a programming language. Programming languages are human languages, a means of producing machine code through symbolic abstractions that are much easier for humans to interpret than native machine code. It should also be noted that programming languages are never developed on a machine, the language is purely abstract and designed according to a specified proposals. The only thing that is actually developed on the machine is the implementation of the machine code program that physically converts the symbolic instruction code into the machine's own native machine code. Before we had any programming languages, all programs had to be written in the machine's own native machine code. Once we had one programming language, we could use it to create translators for other languages and indeed for other machines besides the one on which it executed. Note that it's difficult to know precisely when programming languages were first used because there were many language pioneers working simultaneously, often sharing ideas and evolving designs to the point that it is difficult to determine at what point a language is "fit for human consumption", so to speak. To make matters worse, many early programming languages were proposed but never designed, while others were designed but never implemented. Assembly language is the next step up from machine code. Like machine code, every machine type has its own version of assembly language, and is therefore a low-level language. Unlike machine code, code written in assembly language has to be translated into native machine code before it can be executed because machine code is the one and only language "understood" by the machine. Converting from assembly language to machine code is as tedious and as error prone as writing the machine code itself, however the actual conversion process is trivial enough that we can easily write a small machine code program (known as an assembler) to perform the conversion for us. The earliest known usage of an assembly language dates from 1949 on the EDSAC computer at Cambridge University, where the assembler (known as Initial Orders) was implemented in read-only memory. The inventors were Maurice Wilkes and W. Renwick. High-level languages are more abstract than assembly languages and are generally more portable (not machine dependent). The first high-level programming language was probably Autocode in 1952 on the Mark I computer at the University of Manchester, or Short Code in the same year on the UNIVAC 1. Short Code was based upon an earlier implementation known as Brief Code in 1949 for the BINAC computer, but it was never tested or debugged. Autocode used a compiler program to convert the high-level symbolic code into machine code whereas Short Code used an interpretation program. The difference between the two is that the native machine code produced by a compiler can be stored and executed without any further translation whereas code written in an interpreted language has to be converted by the interpreter program every time it is executed. As a result, compiled programs perform better than interpreted programs. Modern-day Java is an example of a programming language that is both compiled and interpreted. Unlike a traditional compiler, the Java compiler produces byte code which can then be interpreted to produce native machine code. The reason for this multi-conversion is that the same byte code can be executed upon any machine with a Java virtual machine implementation. That is, the byte code is the native language of the virtual machine and is much quicker to interpret than the higher-level source code would be. It also ensures that the intellectual property -- the source code itself -- is not revealed to the user. It is worth noting that Plankalk&uuml;l was designed from 1943 to 1945 for the Z3 and therefore predates assembly language as well as Autocode and Short Code. However it was not actually implemented until 1998, more than 50 years after it was designed!


What is standardization in english language?

english is been refers to as a standardization language because during the 7th and 8th centuries,the germanic tribes needed rules and orders to abide by in spelling the language?


Which program is responsible for enforcing the executive orders that cover companies doing business with the federal government?

OFCCP


How did Romans adapt columns in temples constuction?

The Romans adopted the three Greek orders (styles) of columns: Dorian, Ionic and Corinthian. They also developed the composite order, which combined elements of two orders.


Do phohaors speak a different language to a slave?

I don't think they spoke to slaves. The slave masters gave the orders.


What has the author Darrell Richard Reinke written?

Darrell Richard Reinke has written: 'Luther, the cloister, and the language of monastic devotion' -- subject(s): Language and languages, Monasticism and religious orders, Religious aspects, Religious aspects of Language and languages