[Solved] D-lang being faster than C++? [closed]
find() seems to be heavily used and they are very different in D and C++ implementations: int find(int x) { return ds[x] = (x == ds[x] ? x: find(ds[x])); } vs: long long find(long long node) { if(parents[node] == node)return node; else return find(parents[node]); } find() in D modifies array (looks like some kind of … Read more