InsertSort

Elemento de inserções no array ordenado

bool  InsertSort(
   float  element      // Element to insert
   )

Parâmetros

element

[in]  O valor do elemento a ser inserido em array ordenado

Valor do Retorno

verdadeiro se com sucesso, falso - não pode inserir o elemento.

Exemplo

//--- example for CArrayFloat::InsertSort(float)
#include <Arrays\ArrayFloat.mqh>
//---
void OnStart()
  {
   CArrayFloat *array=new CArrayFloat;
   //---
   if(array==NULL)
     {
      printf("Object create error");
      return;
     }
   //--- add arrays elements
   //--- . . .
   //--- sort array
   array.Sort();
   //--- insert element
   if(!array.InsertSort(100.0))
     {
      printf("Insert error");
      delete array;
      return;
     }
   //--- delete array
   delete array;
  }