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

Function setHorizontalDistance

Trees/BottomView.cpp:23–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void setHorizontalDistance(Tree* root, int hd){
24
25 if(root == NULL)return;
26
27 root->hd = hd;
28 setHorizontalDistance(root->left, hd-1);
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){

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected