dart的列表库使用什么类型的算法?

时间:2015-07-02 17:54:43

标签: algorithm dart

1 个答案:

答案 0 :(得分:5)

Sort的源代码是here。排序调用_doSort辅助方法,如下所示:

static void _doSort(List a, int left, int right, int compare(a, b)) {
  if ((right - left) <= _INSERTION_SORT_THRESHOLD) {
    _insertionSort(a, left, right, compare);
  } else {
    _dualPivotQuicksort(a, left, right, compare);
  }
}