KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
path = 0 # the lenght of the path while self.right != None or self.left != None: while self.right != None: self = self.right path = path +1 while self.left != None: self = self.left path = path +1 return path this is my sample code for find the Height, is defined as the length of the longest path by number of nodes from self to a leaf. The height of a leaf node is 1. it doesn't work.
Tags (comma-separated)
Save Edits
Cancel