The 10-10-1
The 10-10-2
The 10-10-3
The 20-10-2
The 20-10-1
The 10-10-4
Is in front of x and y coordinates, and the last is the coordinates of the tag, I now need to coordinate the same keep only the last one, after processing the result is as follows:
The 20-10-1
The 10-10-4
Who can help me!!!!!!
CodePudding user response:
After traversal Tlist then sort Tlist then from interception of x and Y determine whether current. If x and Y is the same as the front. Agree, delete this is what I wantCodePudding user response:
Utilize Tstringlist can directly sequencedCodePudding user response:
The first four digits, regarded as the index of 0000-9999,Do with another TList records,
In the original TList from first to last, take out four into index,
Set up the new List [Index]='A'
Finally, the new List from 0-9999 to run A circle, every value is' A 'is everything,
CodePudding user response:
I have too many contents, after traversal computingCodePudding user response:
I gave the solution, just a second traversal, is a fast algorithm,If I say yes, with sorting will be slower,
In fact, the more is the right thing when data is processed by the new List I above scheme,
It is fast, no traversal problem,
CodePudding user response:
Sorting itself is the traversalBut only 300000, what computer operations don't come here,,,
CodePudding user response:
1. The traversal, delete the same2. Don't want to write code, but keep the data to the database table, use the SQL processing
CodePudding user response:
Novice a, or talk about?30 w to traversal or time consuming, LS said, in a database, so efficient point,
Personal feel or good algorithm, then can solve many problems
CodePudding user response:
One, in the database;Second, introduce the ID column, the introduction of a unique identifier to each data;
Three, your this a field split in two fields, the split into 10-10-10-10-1, 1
Four, with the GROUP BY HAVING the COUNT function and find out all duplicate data maximum ID (don't know how to use baidu to check),
5, remove the biggest ID data;
Six, synthesize two fields a field,
CodePudding user response: