Ejemplo n.º 1
0
int main(int argc, const char *argv[])
{
    int v[5000], x, n;
    clock_t ti1, tf1, ti2, tf2;
    printf("digite o tamanho do vetor:\n");
    scanf("%d",&n);
    array_creator(n, v);
 
    printf("digite o termo a ser procurado:\n");
    scanf("%d",&x);
    ti1 = clock();
    busca_binaria(x, n, v);
    tf1 = clock();
    printf("Tempo da busca binária: ");
    tempo(ti1, tf1);
    
    ti2 = clock();
    busca_sequencial(n, v, x);
    tf2 = clock();
    printf("Tempo da busca sequencial: ");
    tempo(ti2,tf2);



    return 0;
}
Ejemplo n.º 2
0
int main(int argc, const char * argv[])
{
    char country_string[100] = "USA. Canada, Mexico,Bermuda Grenada,Belize Germany.Korea";
    char delim[MAX] = ", .";
    
    array_creator(country_string, delim);
    
    return 0;
}
Ejemplo n.º 3
0
int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent )
{
    // first, check if we have a selection, or try to get one
    SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
    const SELECTION& selection = selTool->GetSelection();

    // pick up items under the cursor if needed
    if( !hoverSelection( selection ) )
        return 0;

    // we have a selection to work on now, so start the tool process

    PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
    editFrame->OnModify();

    GAL_ARRAY_CREATOR array_creator( *editFrame, m_editModules,
                                     getModel<BOARD>()->GetRatsnest(),
                                     selection );

    array_creator.Invoke();

    return 0;
}