main() { struct lista *l; int k; clrscr(); l=init_l(l); printf(" \n \n LISTA INITIALA : "); tipar(l); printf(" \n \n CHEIA DE ELIMINAT:"); scanf("%d",&k); l=elim_l(l,k); printf(" \n \n NOUA LISTA ESTE : "); tipar(l); getch(); }
void bkt(int *st, int k, int N) { init(st, k); while (succesor(st, k, N)) { if (valid(st, k)) if (solutie(st, k, N)) tipar(st, k); else bkt(st, k + 1, N); } }
struct lista *elim_l(struct lista *l,int k) { struct lista *capat; tipar(l); if (l->k == k) return(l->next); else { capat=l; while ((l->next) && (l->next->k!=k))l=l->next; if (l->next) l->next=l->next->next; return(capat); } }