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

Function bottomView

Trees/BottomView.cpp:31–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 setHorizontalDistance(root->right, hd +1);
30}
31void bottomView(Tree *root, map<int, pair<int,int>>&m, int d){
32if(root == NULL)return;
33if(m[root->hd].first < d){
34m[root->hd].first = d;
35m[root->hd].second = root->data;
36}
37if(root->left)
38bottomView(root->left, m, d+1 );
39
40if(root->right)
41bottomView(root->right, m, d+1);
42}
43
44int main(){
45

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected