InsertSort
Elemento de inserções no array ordenado
bool InsertSort(
long element
)
|
Parâmetros
element
[in] O valor do elemento a ser inserido em array ordenado
Valor do Retorno
Exemplo
//--- example for CArrayLong::InsertSort(long)
#include <Arrays\ArrayLong.mqh>
//---
void OnStart()
{
CArrayLong *array=new CArrayLong;
//---
if(array==NULL)
{
printf("Object create error");
return;
}
//--- add arrays elements
//--- . . .
//--- sort array
array.Sort();
//--- insert element
if(!array.InsertSort(1000000))
{
printf("Insert error");
delete array;
return;
}
//--- delete array
delete array;
}
|