Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void suchbaum::knoten_ausgeben(BaumKnoten* knoten, int tiefe) {
- if (knoten==nullptr)
- {
- return;
- }
- int depth = tiefe;
- knoten_ausgeben(knoten->right_child,depth+1);
- if (depth!=0)
- {
- for (int i = 1; i <= depth * 2; i++)
- cout << "+";
- }
- cout << knoten->data << "\n";
- knoten_ausgeben(knoten->left_child, depth+1);
- }
- void suchbaum::ausgeben(BaumKnoten* wurzel) {
- if (wurzel == nullptr)
- {
- cout << "Leerer Baum."<<endl;
- }
- else
- {
- suchbaum::knoten_ausgeben(wurzel, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement