System.Generics.Collections.TArray.Sort

提供: RAD Studio API Documentation
移動先: 案内検索

Delphi

class procedure Sort<T>(var Values: array of T); overload; static;
class procedure Sort<T>(var Values: array of T; const Comparer: IComparer<T>); overload; static;
class procedure Sort<T>(var Values: array of T;
const Comparer: IComparer<T>; Index, Count: Integer); overload; static;

C++

template<typename T> static void __fastcall Sort(T *Values, const int Values_High)/* overload */;
template<typename T> static void __fastcall Sort(T *Values, const int Values_High, const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > Comparer)/* overload */;
template<typename T> static void __fastcall Sort(T *Values, const int Values_High, const System::DelphiInterface<System::Generics::Defaults::IComparer__1<T> > Comparer, int Index, int Count)/* overload */;

プロパティ

種類 可視性 ソース ユニット
procedure
function
public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TArray

説明

ジェネリック配列をソートします。

このメソッドは、O(n log n) の計算量の操作(n は 配列内の要素数)を使って、ジェネリック配列 Values をソートします。クイックソート アルゴリズムが用いられるので、等しい要素の順序が変わる場合があります。

メモ:  Comparer パラメータが指定されている場合、要素の比較に使用されます。指定されていない場合は、配列要素のデフォルトの比較クラスが使用されます。

関連項目