Why does the Sorting Algorithm of the same 10 million array take 0.5 seconds for C # and 0.6 seconds for C language?
C Language Algorithm Library
C # Call example:[Dllimport ("bwsyqindex. dll")]Public static extern void hzsort (INT [] Mi, int num_elements );
Protected void page_load (Object sender, eventargs E){Int iup = 1000000;Random RO = new random (10000000 );Long tick = datetime. Now. ticks;
Int [] A =
public class Demo1 {public static void main (string[] args) {listA program, enter 10 integers, and put in the array, first descending output all the number, and then statistics and output the number of positive, negative and zero
The subject asks for a given x from the input n integers. If found, the position of the output x (starting from 0), if not found, outputs "not Found".Input format:The input gives 2 positive integers n (Output format:Prints the position of x in a row, or "not Found".Input Sample 1:5 73 5 7 1 9Output Example 1:2Input Sample 2:5 73 5 8 1 9Output Example 2:Not Found#include int main () {int n,x,i,flag=1;scanf ("%d%d", n,x);long int str[25];for (i=0;iscanf ("%ld", str[i]);}for (i=0;iif (str[i]==x) {p
Job: Example 5.7 use the selection method to sort the 10 integers in the array in ascending order. The function method is required ., 5.7 from small to large
# Include
At the end of the 18th century, Gauss defined the so-called concept of coequal. This thing is almost everywhere in discrete mathematics and has many functions. In particular, many encryption algorithms are useful now. The same power is also based on a small knowledge of the same remainder, mainly because it is easier to calculate the power of a very large integer and then evaluate the modulo, so it will be used accidentally. So today, I wrote a function to facilitate future use. At the same time
/*************************************** * ******************************* // 10. in the array, find the number of times a given number appears *//******************************* **************************************** * /// binary search, binary Search for the location where the key appears for the first time, binary search for the key that appears for the last time // returns the subtraction of the two +
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.