Advertisement
rootuss

Untitled

Mar 25th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.     void printBT(string sp, string sn, int v)
  2.     {
  3.         string s;
  4.  
  5.         if (v < currentSize)
  6.         {
  7.             s = sp;
  8.             if (sn == cr) s[s.length() - 2] = ' ';
  9.             printBT(s + cp, cr, 2 * v + 2);
  10.  
  11.             s = s.substr(0, sp.length() - 2);
  12.  
  13.             cout << s << sn << table[v] << endl;
  14.  
  15.             s = sp;
  16.             if (sn == cl) s[s.length() - 2] = ' ';
  17.             printBT(s + cp, cl, 2 * v + 1);
  18.         }
  19.     }
  20.  
  21.  
  22.     void display()                              //wyswietlanie kopca z podzialem na poziomy
  23.     {   cr = cl = cp = "  ";
  24.         cr[0] = 218; cr[1] = 196;
  25.         cl[0] = 192; cl[1] = 196;
  26.         cp[0] = 179;
  27.  
  28.         printBT("", "", 0);
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement