michael_hartman_cz

CReactNode * copyTree ( CReactNode * node )

Apr 2nd, 2014
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. CReactNode * copyTree ( CReactNode * node )
  2.  {
  3.     if ( node -> m_L == NULL && node -> m_R == NULL )
  4.         return new CReactNode (node -> m_Product, node -> m_Energy, NULL, NULL);
  5.     return new CReactNode (node -> m_Product, node -> m_Energy, copyTree (node -> m_L), copyTree (node -> m_R));
  6.  }
Advertisement
Add Comment
Please, Sign In to add comment