Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include "arbol.h"
- void arbolduplicado(TNode *node,TBinaryTree *D){
- if (node==NULL)
- return;
- insert(D,node->elem);
- insert(D,node->elem);
- arbolduplicado(node->left,D);
- arbolduplicado(node->right,D);
- }
- int main(){
- TBinaryTree T;
- init_tree(&T);
- TBinaryTree D;
- init_tree(&D);
- insert(&T,2);
- insert(&T,1);
- insert(&T,3);
- preorden(T.root);
- arbolduplicado(T.root,&D);
- printf("\n");
- preorden(D.root);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment