Help with an algorithm!

MGW via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 15 06:41:07 PDT 2017


On Thursday, 15 June 2017 at 13:16:24 UTC, CRAIG DILLABAUGH wrote:

The purpose - search of changes in file system.
Sorting is a slow operation as well as hashing. Creation of a 
tree, is equally in sorting.
So far the best result:

string[] rez;

foreach(str; m2) {
	bool fFind;	int j;
	foreach(int i, s; m1) {
		if(str == s) { fFind = true; j = i; break; }
	}
	if(!fFind) { rez ~= str; }
	else       { 	m1[j] = m1[$-1]; m1.length = m1.length - 1; 	}
}
		
//  rez => rezult

How to parallel on thred?


More information about the Digitalmars-d-learn mailing list