Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bstRecPreOrderMap(BSTNode* radice, MapFun op,void* _ )
- {
- op(radice->data,_);
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,_);
- }
- void bstRecInOrderMap(BSTNode* radice, MapFun op,void* _ )
- {
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,_);
- op(radice->data,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,_);
- }
- void bstRecPostOrderMap(BSTNode* radice, MapFun op,void* _ )
- {
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,_);
- op(radice->data,_);
- }
- void bstRecBreadthMap(BSTNode* radice, MapFun op,void* _ )
- {
- printf("\n non disponibile per le ricorsioni");
- }
- /* ******************************************************* */
- void bstRecPreOrderFold(BSTNode* radice,FoldFun op , void* par,void* _ )
- {
- op(radice->data,par,_);
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,par,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,par,_);
- }
- void bstRecInOrderFold(BSTNode* radice,FoldFun op , void* par,void* _ )
- {
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,par,_);
- op(radice->data,par,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,par,_);
- }
- void bstRecPostOrderFold(BSTNode* radice,FoldFun op , void* par,void* _ )
- {
- if(radice->sx)bstRecPreOrderMap(radice->sx,op,par,_);
- if(radice->dx)bstRecPreOrderMap(radice->dx,op,par,_);
- op(radice->data,par,_);
- }
- void bstRecBreadthFold(BSTNode* radice,FoldFun op , void* par,void* _ )
- {
- printf("\nnon disponibile per la ricorsione");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement