I'm kinda new to python and I can't get past this error:
Traceback (most recent call last):File "***", line 63, in <module>bst = Node()
TypeError: __init__() missing 1 required positional argument: 'val'
Basically, the program is a BST which would allow you to insert, search and look for the minimum item by only going left.
Here's the code (sorry, it's hungarian)
class Node:def __init__(self, val):self.ertek = valself.balgyerek = None self.jobbgyerek = Noneself.gyoker = Nonedef beszur(self, pri):if self.gyoker: return self.gyoker.beszur(pri)else: self.gyoker = Node(pri)return Trueif self.ertek == pri: return Falseelif self.ertek > pri: if self.balgyerek: return self.balgyerek.beszur(pri) else:self.balgyerek = Node(pri) return Trueelse: if self.jobbgyerek:return self.jobbgyerek.beszur(pri)else:self.jobbgyerek = Node(pri)return Truedef keres(self, pri):if self.gyoker: return self.gyoker.keres(pri) else: return False if(self.ertek == pri): return Trueelif self.ertek > pri: if self.balgyerek:return self.balgyerek.keres(pri) else:return False else:if self.jobbgyerek:return self.jobbgyerek.keres(pri)else:return Falsedef minimumertek(self): jelenlegi = selfwhile(jelenlegi.balgyerek is not None):jelenlegi = jelenlegi.balgyerekreturn self.ertek bst = Node()