Advertisement
cepxuozab

NextLastNextStep

Sep 21st, 2023
671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. void NextLast() {
  2.         auto root = N(66, N(44, N(33), N(55)), N(88, N(77)));
  3.         cout << root->value << endl;
  4.  
  5.         auto iter = begin(root.get());
  6.  
  7.         int i = 0;
  8.  
  9.         while (i < 6) {
  10.             iter = next(iter);
  11.             ++i;
  12.         }
  13.         ASSERT(!iter);
  14.     }
  15.  
  16.     void NextStep() {
  17.         auto root = N(66, N(44, N(33), N(55)), N(88, N(77)));
  18.         cout << root->value << endl;
  19.  
  20.         auto iter = begin(root.get());
  21.  
  22.         while (iter) {
  23.             cout << iter->value << " "s;
  24.             iter = next(iter);
  25.         }
  26.         cout << endl;
  27.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement