MCPcopy Create free account
hub / github.com/davisking/dlib / tree_height

Method tree_height

dlib/binary_search_tree/binary_search_tree_kernel_2.h:1839–1853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1837 typename compare
1838 >
1839 short binary_search_tree_kernel_2<domain,range,mem_manager,compare>::
1840 tree_height (
1841 node* t
1842 ) const
1843 {
1844 if (t == NIL)
1845 return 0;
1846
1847 short height1 = tree_height(t->left);
1848 short height2 = tree_height(t->right);
1849 if (height1 > height2)
1850 return height1 + 1;
1851 else
1852 return height2 + 1;
1853 }
1854
1855// ----------------------------------------------------------------------------------------
1856

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected