I think we should write the maxxorfunctioncall in the for loop after ther insert function call loop

max xor pair
i think we should write the maxxorfunctioncall in the for loop after ther insert function call loop

hello @guptarahul3100
yeah u can do that as well it will not create any difference.

no,i think this will create a difference.
for example-3,10,5,25,2,8
just after inserting 3 in the tries,u are calling the maxorfunction for camparing with other values which are not still inserted in the trie .

waiting for your response!


we are callingmaxxor function for comparing with values that are already inserted.

are u calling the maxxorfunction after inserting all the values in the trie

no , iterating i= from 0 to n-1 then insert a[i] ,call maxxor function.

trie* head = new trie() ;
for(int i= 0 ; i<n;i++){
cin >> a[i] ;
insert(head,a[i]) ;
}
int maxv = 0 ;
for(int i = 0 ; i<n;i++){
int m = maxxorpair(head,a[i]) ;
maxv = max(m,maxv) ;

i think this is the right approach,i am bit confused can get ur phone number

this is also correct,
video tutorial is already there pls check ,
sorry cant give my number.

u can ask it here i will help u.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.