3 research outputs found

    Union-find-delete-algoritmien vertailua

    Get PDF
    Union-find-algoritmi on tehokas ratkaisu erillisten joukkojen käsittelyongelmaan. Union-find-delete-algoritmissa siihen on lisätty poiston mahdollisuus. Esittelen tässä tutkielmassa useita union-find-algoritmeja ja union-find-delete-algoritmeja ja vertailen niitä teoreettisesti ja kokeellisesti. Toteutin kolme erilaista union-find-delete-algoritmia, ja testasin niitä satunnaisilla syötteillä. Toteuttamani algoritmit ovat Ben-Amramin ja Yoffen algoritmi, aidon poiston algoritmi ja vajaan poiston algoritmi. Testieni perusteella vaikuttaa siltä, että asymptoottiselta aikavaatimukseltaan huonompi aidon poiston algoritmi toimii keskimäärin yhtä hyvin tai jopa paremmin kuin Ben-Amramin ja Yoffen algoritmi, jossa poisto tehdään vakioajassa

    A Simple and Efficient Union-Find-Delete Algorithm

    Get PDF
    The Union-Find data structure for maintaning disjoint sets is one of the best known and widespread data structures, in particular the version with constant-time Union and efficient Find. Recently, the question of how to handle deletions from the structure in an efficient manner has been taken up, first by Kaplan, Shafrir and Tarjan (2002) and subsequently by Alstrup et al. (2005). The latter work shows that it is possible to implement deletions in constant time, without affecting adversely the asymptotic complexity of other operations, even when this complexity is calculated as a function of the current size of the set. In this note we present a conceptual and technical simplification of the algorithm, which has the same theoretical efficiency, and is probably more attractive in practice. Keywords: Data structures, Disjoint sets, Union-Find
    corecore