InsertSort
Fügt ein Element in ein sortiertes Array ein.
bool InsertSort(
short element
)
|
Parameter
element
[in] Wert des Elements um ins sortierte Array einzufügen.
Rückgabewert
Beispiel:
//--- example for CArrayShort::InsertSort(short)
#include <Arrays\ArrayShort.mqh>
//---
void OnStart()
{
CArrayShort *array=new CArrayShort;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- add arrays elements
//--- . . .
//--- sort array
array.Sort();
//--- insert element
if(!array.InsertSort(100))
{
printf("Insert error");
delete array;
return;
}
//--- delete array
delete array;
}
|