Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int nElementos(No* p){
- if(p->prox == NULL){
- return 1;
- }
- else{
- return 1 + nElementos(p->prox)
- }
- }
- int nElementos(No* p){
- if(p == NULL)
- return 0;
- int cont = 0;
- No* x = *p;
- while(x != NULL){
- cont++;
- x = x->prox;
- }
- return cont;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement