daily pastebin goal
10%
SHARE
TWEET

Untitled

a guest Oct 31st, 2014 888 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int findcenter(int current, int parent, int total){
  2.    
  3.     for(int i=0;i<(int)adjacency_list[current].size();i++)
  4.     {
  5.         int next = adjacency_list[current][i];
  6.        
  7.         if(next == parent or deleted[next])continue;
  8.        
  9.         if(total/2 < size[current] + 1)
  10.             return findcenter(next, current, total);
  11.     }
  12.    
  13.     return current;
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top