Overlap in python

Bearophile bearophileHUGS at lycos.com
Tue Aug 4 18:10:33 EDT 2009


kj:
>     # connect the nodes
>     for i in range(len(parts) - 1):
>         part_i = parts[i]
>         for j in range(i + 1, len(parts)):

Note that's O(N^2), see the O(sort) standard solution by Mark
Dickinson.

Bye,
bearophile



More information about the Python-list mailing list