void House::flipFirstCard(){ Card* card = pop_first(); card->flip(); push_first(card); }
void COADA(stk *head) { int option = 1; int chose; while (option) { system("CLS"); printf(" QUE\n"); printf("--------------------------------\n"); printf(" 1. PUSH \n"); printf(" 2. POP\n"); printf(" 3. SHOW MAX\n"); printf(" 4. SHOW MAX\n"); printf(" 5. SHOW\n"); printf(" 6. BACK TO MAIN\n"); printf(" Insert you choice : "); scanf("%d", &chose); switch (chose) { case 1: push_back(head); break; case 2: pop_first(head); break; case 3: get_max(head); break; case 4: get_min(head); break; case 5: show_list(head); break; case 6: main(); default: printf("Wrong choice ! \n"); Sleep(2000); break; } } }
/* GRAPH FUNCTIONS*/ void dfs(Nod *head, int numberNodes, int root, int adiacentMatrix[100][100], int vectorVisit[100]){ int i, j; push_first(head, root); while(head->next != NULL){ root = pop_first(head); vectorVisit[root] = 1; printf(" %d ", root); for(i = numberNodes; i >= 1; i--){ if(adiacentMatrix[root][i] == 1 && vectorVisit[i] == 0){ push_first(head, i); } } } for(i = numberNodes; i >= 1; i--){ vectorVisit[i] = 0; } }
int tnag(t_graph *ptr) { char *buff; int *ret; if (ptr->pos == NULL) ptr->pos = g_serv.opt.team.first; if ((buff = malloc(strlen(((t_team*)ptr->pos->data)->name) + 8)) == NULL) return (FAIL); sprintf(buff, "tna %s", ((t_team*)ptr->pos->data)->name); if (append(&ptr->send, buff) == FAIL) { free(buff); return (FAIL); } ptr->pos = ptr->pos->next; if (ptr->pos == NULL) { ret = pop_first(&ptr->cmd); free(ret); } return (NONE); }
// http://www.csie.ntnu.edu.tw/~u91029/Half-planeIntersection.html FOR(i, lines) { pop_last(*i); pop_first(*i); dq.push_back(*i); }