The algorithm for finding an array, the formula for calculating the number of groups

Updated on educate 2024-04-08
13 answers
  1. Anonymous users2024-02-07

    Programs that have been debugged. Hope it helps.

    import ;

    import ;

    public class calculate ;

    string num =;

    hashtable cal = new hashtable();

    for(int i = 0 ; i < i++)if(,"+num[i]);

    num[i]);

    name = new string[

    num = new string[

    enumerationenum = ;

    for(int i = 0 ; i < i++)name[i] = ;

    num[i] = ;

    +num[i]);

  2. Anonymous users2024-02-06

    For name, consider set, you can eliminate duplicate elements and be efficient.

    setset = new treeset();

    for(string namestr: name);

    string num = ;

    object objs = formatarray(name, num);

    string newname = (string)objs[0];

    string newnum = (string)objs[1];

    for(int i = - 1; i >= 0; i--)

    \t" + newnum[i]);

    private static object formatarray(string name, string num) {

    mapmap = new hashmap();

    for(int i = 0, len = ; i < len; i++)

    string item = name[i];

    if(, "," + num[i]);If it is already included, take out the original value and add the current value.

    else{, num[i]);If not, add it to the map.

    string newnameary = string[0]);

    string newnumary = string[0]);

    object objs = new object[2];

    objs[0] = newnameary;

    objs[1] = newnumary;

    return objs;

    aa 123,234

    bb 235,543

    cc 145

  3. Anonymous users2024-02-05

    #include

    int main()

    int a[7]=,k[10];

    int m,i,j=0,h=0;

    scanf("%d",&m);

    for(i=0;i<7;i++)

    if(a[i]<=m&&a[i+1]>=m&&h==0)else k[j++]=a[i];

    for(i=0;iprintf("%d ",k[i]);

    return 0;

    What if the original order was from largest to smallest, or if there was uncertainty from small to large? How should it be written?

    If it's an exam, or test question, the chance of this happening is 0 because it gives a known array to determine whether to sort by up or down!

    If int a[7]=, the program is sorted by liters!

  4. Anonymous users2024-02-04

    public string hebing(string s)string a=null;

    for(int i=0;i<;i++)

    a=s[i];

    for(int j=i+1;j<;j++)if(

    s[j]=s[j+1];

    I just wrote a run that you can try.

  5. Anonymous users2024-02-03

    The formula for calculating the number of groups and groups: number of groups = (range range group spacing) + 1, then group spacing = range (number of groups - 1).

    Group spacing is the distance between the maximum value (upper group limit) and the minimum value (lower group bound) in a set of data. The number of groups and the group spacing are related to each other, in the same variable series, the group spacing is smaller, and conversely, the smaller the group spacing, the larger the group spacing, and the two are inversely proportional. The number of groups divided into groups is called the number of groups, and the distance between the two ephemeral endpoints of each group is called the group distance.

  6. Anonymous users2024-02-02

    Number of groups = (range range of group spacing) + 1

    Number of groups: The number of groups is called the number of groups, and the difference between the two endpoints of each group is called the group spacing.

    The formula for the number of groups refers to taking any m(m n) elements from n different elements and forming a group, which is called taking out a combination of m elements from n different elements; The number of all combinations of m (m n) elements taken out of n different elements is called the number of combinations of m elements taken out of n different elements. It is denoted by the symbol c(n,m).

    The number of groups is the number of groupsIn the case of a certain population under study, the number of groups and the size of the group spacing are closely related. Generally speaking, the number of groups is inversely proportional to the distance between groups. When the same phenomenon is grouped, the number of groups is small, and the group distance is large. If the number of groups is large, the group spacing is small.

    If the number of groups is too large and the group spacing is too small, the group data will be cumbersome and complex, and it will be difficult to show the internal characteristics and distribution rules of the whole. If the number of groups is too small and the distance between groups is too large, the significance of grouping may be lost, and the purpose of correctly reflecting objective facts will not be achieved.

    The above content reference: Encyclopedia - Number of Groups.

  7. Anonymous users2024-02-01

    Number of Groups We call the number of groups the number of groups, and the difference between the two endpoints of each group is called the group spacing.

    Number of groups = (range range of group spacing) + 1

  8. Anonymous users2024-01-31

    We call the number of groups the number of groups, and the distance between the two endpoints of each group is called the group distance. Number of groups = range Range range of group distance = maximum value - minimum value of this set of data.

    Number of groups = (range range of group spacing) + 1

    It means to take the integer part of the number, if it is, then take 2 If you know the group spacing of a group of data, you want to determine the number of groups, the method is: divide the range by the group spacing, if the result is an integer, the number of groups should add 1 to the result, if the result is not an integer, the number of groups should use the result to take an integer.

  9. Anonymous users2024-01-30

    1. Discretize all black dot curved coordinate values.

    2. Process the black dot data into two copies:

    A, connect the points of the same column into a small line segment, that is, the adjacent points in the same column are connected into a line segment, there is no black spot in the middle of the line segment except for two endpoints, the line segment can be represented by C(Y1, Y2, X), wherein Y1B, the point of the peer is split into a large line segment, that is, only the two farthest points in the peer are connected, and the rest of the points are included in the line segment, and the line segment can be represented by R(X1, X2, Y), wherein X13, the large line segment is processed one by one according to the Y value from small to large, and two data structures are required in the process:

    The tree array ta:ta[x] represents the number of column segments that intersect the line where the current row segment is located and whose ends are not on the line.

    Priority queue qu: The line segment of the column is stored in the queue, and the value of y2 is small.

    In addition, it is necessary to record the variable cnt of the number of white dots that meet the conditions, and then the specific processing steps for each row segment:

    1) Add all the column segments that meet the requirements of the column line segment to be processed, and ta[plus 1.

    2) Dequeue all column segments in qu that satisfy <=, and ta[minus 1.

    3) CNT+= The sum of the tree array ta, that is, the number of column segments that intersect with the current row segments.

    4. After processing all the line segments, cnt is the answer.

    The dequeue and inbound of the priority queue are both o(logn), and the addition and subtraction of array elements and the sum of array elements of the tree array are also o(logn), and the specific principle will not be discussed here. While it is possible to queue and queue multiple column segments when processing each row segment, the overall situation is that each column segment is queued out of the queue only once.

    This is my way of thinking, it has not been practiced, and there are questions that can be discussed

  10. Anonymous users2024-01-29

    The number of skins of the group of friends.

    We call the difference before the number of groups the number of groups, and the difference between the two endpoints of each hungry group is called the group spacing.

    Number of groups = (range range of group spacing) + 1

  11. Anonymous users2024-01-28

    Problem: Finding an algorithm is a problem about arrays.

    2 billion * 2 billion points are represented in black and white, and the minimum memory required is: 2 billion * 2 billion 8 bytes, about 2 31 * 2 31 8 = 1g * 500m bytes, is this a joke.

  12. Anonymous users2024-01-27

    It seems that it can only be exhaustive, take out each coordinate point, and then find out the points around the point, and judge, if it is correct, the count variable is +1. Judgment statements can be encapsulated into a function body and called repeatedly.

  13. Anonymous users2024-01-26

    The theater of life is a cycle of drama that is scattered and separated.

Related questions
9 answers2024-04-08

program divided;var n,i,s:integer;begin s:=0;counters, which are used to count about a number of numbers; readln(n);Enter the original number; for i: >>>More

8 answers2024-04-08

For multiplication problems, just multiply that number by a fraction.

3 answers2024-04-08

The characteristics of the MD5 algorithm are as follows:1. The length is fixed. Regardless of how many bytes of information are inputted, the output bytes are always 16 bytes. >>>More

14 answers2024-04-08

Percentage practice questions.

1. A is 2, B is 3, A is B ( ) B is a ( ) A is the sum of A and B ( ) B is the sum of A and B ( ) How many percent is in parentheses). >>>More

18 answers2024-04-08

Let the original number be x; After expanding by 100 times, it is x(1+100), which is larger than the original number; Therefore x(1+100)=x+ ==> x=, i.e., x=. Answer: The original number is. >>>More