MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

Trees/BottomView.cpp:44–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44int main(){
45
46 Tree *root = newNode(20);
47 root->left = newNode(8);
48 root->right = newNode(22);
49 root->left->left = newNode(5);
50 root->left->right = newNode(3);
51 root->right->left = newNode(4);
52 root->right->right = newNode(25);
53 root->left->right->left = newNode(10);
54 root->left->right->right = newNode(14);
55
56 setHorizontalDistance(root, 0);
57
58 map<int, pair<int, int>>m;
59 bottomView(root, m, 1);
60
61 for(auto x: m){
62 cout<<x.second.second<<" ";
63 }
64
65
66
67 return 0;
68}

Callers

nothing calls this directly

Calls 3

setHorizontalDistanceFunction · 0.85
bottomViewFunction · 0.85
newNodeFunction · 0.70

Tested by

no test coverage detected