Advertisement
hurmawe

декартовое дерево 2

Mar 5th, 2021
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. bool search(node* A, int need_found) // поиск элементов.
  2. {
  3.     if (!A)
  4.         return false;
  5.  
  6.     if (A->value_node == need_found)
  7.         return true;
  8.  
  9.     if (A->value_node < need_found)
  10.     {
  11.         return search(A->right, need_found);
  12.     }
  13.     else
  14.     {
  15.         return search(A->left, need_found);
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement