On your recursive lines, you do not return anything. If you want it to return 0, you should replace them with lines like:
return self.insert(key, root=tmp.left)
instead of just
self.insert(key, root=tmp.left)
More Related Contents:
- Why does this recursion return 0?
- One line recursive loop in python
- Nested defaultdict of defaultdict
- Recursive code returns None [duplicate]
- How to do a recursive sub-folder search and return files in a list?
- Finding a key recursively in a dictionary
- How can I build a recursive function in python? [duplicate]
- Can a lambda function call itself recursively in Python?
- Function with varying number of For Loops (python)
- How to flatten a nested JSON recursively, with flatten_json
- Hitting Maximum Recursion Depth Using Pickle / cPickle
- Python recursive function error: “maximum recursion depth exceeded” [duplicate]
- Setting property causes maximum recursion depth exceeded
- Can generators be recursive?
- What is the hard recursion limit for Linux, Mac and Windows?
- Process finished with exit code -1073741571
- Confusing […] List in Python: What is it?
- Generate all possible lists of length N that sum to S in Python
- python ctype recursive structures
- Flattening a list recursively [duplicate]
- Is there a recursive version of the dict.get() built-in?
- Python: maximum recursion depth exceeded while calling a Python object
- Why does Python have a maximum recursion depth?
- Recursive generator for flattening nested lists
- Python recursive function to display all subsets of given set
- Finding all maze solutions with Python
- Valid characters in a String
- getattr and setattr on nested subobjects / chained properties?
- How to constuct a column of data frame recursively with pandas-python?
- Cross product of sets using recursion