Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- nodo* cerca2_infix(nodo* r,int n,int*C){
- if(!r) return NULL;//CB1
- if(r->num<n) return NULL;//CB2
- if(r->left && r->left->num>=n )//SAS
- return cerca2_infix(r->left,n);
- else{//PRE non รจ sicuramente nel SAS ed il nodo รจ presente
- if(r->left)//chack SAS
- n=n-r->left->num;
- if(--n)//decrementazione e controllo di n
- return cerca2_infix(r->right,n);//SAD
- else
- return r;//radice sottoalbero corrente
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement