Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. void noleaf(struct node *here)
  2. {
  3. if((temp -> left != NULL) || (temp -> right != NULL))
  4. {
  5. printf("%d" , temp -> data) ;
  6. if(temp -> left != NULL)
  7. {
  8. noleaf(temp -> left) ;
  9. }
  10. }
  11. noleaf(temp -> right) ;
  12. return 0 ;
  13. }
  14.  
  15. struct node *Mirror(struct node *t)
  16. {
  17. if(t == NULL)
  18. {
  19. return 0 ;
  20. }
  21. else
  22. {
  23. nn = (struct node *)malloc(sizeof(struct node)) ;
  24. nn -> data = t -> data ;
  25. nn -> left = Mirror(t -> right);
  26. nn -> right = Mirror(t -> left) ;
  27. return nn ;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement