A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/d1/d12/tree_8cpp_source.html below:

TheAlgorithms/C++: data_structures/tree.cpp Source File

11void

CreateTree(

node

*curr,

node

*n,

int

x,

char

pos) {

14

cout <<

"\nLeft or Right of "

<< n->val <<

" : "

;

17

CreateTree(n, n->left, x, ch);

19

CreateTree(n, n->right, x, ch);

27

}

else if

(pos ==

'r'

) {

38 while

(!queue.empty()) {

40

cout << n->val <<

" "

;

44

queue.push_back(n->left);

46

queue.push_back(n->right);

52

cout << n->val <<

" "

;

61

cout << n->val <<

" "

;

70

cout << n->val <<

" "

;

78

cout <<

"\nEnter the value of root node :"

;

84

cout <<

"\n1. Insert"

;

85

cout <<

"\n2. Breadth First"

;

86

cout <<

"\n3. Preorder Depth First"

;

87

cout <<

"\n4. Inorder Depth First"

;

88

cout <<

"\n5. Postorder Depth First"

;

90

cout <<

"\nEnter Your Choice : "

;

96

cout <<

"\nEnter the value to be Inserted : "

;

98

cout <<

"\nLeft or Right of Root : "

;

101

CreateTree(root, root->left, x, pos);

102 else if

(pos ==

'r'

)

103

CreateTree(root, root->right, x, pos);

struct node { int data; int height; struct node *left; struct node *right;} node

for std::queue

int main()

Main function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4