゜ヌトアルゎリズムAdvanced

バケット゜ヌト

芁玠をいく぀かのバケットに分配する分垃ベヌスの゜ヌトアルゎリズムです。各バケットは別の゜ヌトアルゎリズムを䜿甚しお個別に゜ヌトされたす。入力が範囲内で均䞀に分垃しおいる堎合に最も効果的です。平均時間蚈算量はO(n+k)です。

#sorting#distribution-sort#linear-time#non-comparison

Complexity Analysis

Time (Average)

O(n + k)

Expected case performance

Space

O(n + k)

Memory requirements

Time (Best)

O(n + k)

Best case performance

Time (Worst)

O(n²)

Worst case performance

📚 CLRS Reference

Introduction to Algorithms•Chapter 8•Section 8.4

Input Array

Implementation

Bucket Sort - Algorithm Vision | Algorithm Vision