Home > Net >  Comparison of two set, consult everybody masters or an efficient algorithm to solve problem
Comparison of two set, consult everybody masters or an efficient algorithm to solve problem

Time:12-10

Comparison of the two set, consult everybody a efficient algorithm or problem solution

Existing LIST1 and LIST2, row * column=5000 * 5

Table 1 of the first semester
Name of physics of Chinese maths English
Top 10 20 30 to 40
Old two 10 20 30 to 40
Old 10 20 30 to 40
Old four 10 20 30 to 40
.
.
.

Table 2 second semester
Name of physics of Chinese maths English
Old two 10 20 to 30 50
Top 10 20 30 to 40
Old 10 20 to 40 40
Old four 10 20 30 to 40
.
.
.
Store name and row position will change, names not repeat
Want to find out the second semester exam type 10 points higher than the only branch of the first semester, regardless of which section 10 points higher than that of launch name
Two layers of loop is too slow
Cases, as a result, second, third
Other: dealing with such problems have on the garage floor first, after comparison, then take the results of such solutions

CodePudding user response:

Put the join in the database once the results what is there against it?

CodePudding user response:

Besides behind you should be more than it needs, someone transfer also want to find out,,,,,,,,,,,,,,,,,,,,,

CodePudding user response:

Today the second identical question

You do not intend to make L1 hash dictionary
?If L1 is a dictionary, then you only need to loop L2

This algorithm is 2 n, rather than a double circulation index level

CodePudding user response:

reference wanghui0380 reply: 3/f
2 identical question today

You do not intend to make L1 hash dictionary
?If L1 is a dictionary, then you only need to loop L2

This algorithm is 2 n, rather than a double circulation index level


So please give me code,,, if convenient

CodePudding user response:

reference 1st floor lorimoon response:
put database join me out of the results and what is there against it?
is also considered to be born, but save a take efficiency may affect many, this is only an example, the reality is need not contrast two tables, look have can not fall to the ground and efficient way
  •  Tags:  
  • C#
  • Related