Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. void nivel(ABin a, int k, SList *l, int level){
  2. if (!a) return;
  3. if(k == level){
  4. SList n = (SList)malloc(sizeof(struct slist));
  5. n->value = a->value;
  6. n->next=(*l);
  7. (*l) = n;
  8. return;
  9. }else{
  10. nivel(a->left, k, l, level+1);
  11. nivel(a->right, k, l, level+1);
  12. }
  13. }
  14.  
  15. typedef struct slist
  16. {
  17. int value;
  18. struct slist* next;
  19. } *SList;
  20.  
  21. typedef struct arvbin* ABin;
  22. typedef struct arvbin
  23. {
  24. int value;
  25. ABin right;
  26. ABin left;
  27. } arvb;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement