Please create method bfs(start) and dfs(start) in PYTHON.
The starter code can be found below. Please do not edit thestarter code at all.
class Node:
def __init__(self, value):
self.value = value
self.next = None
def __str__(self):
return “Node({})”.format(self.value)
__repr__ = __str__
class Stack:
def __init__(self):
self.top = None
self.count = 0
def __str__(self):
temp=self.top
out=[]
while temp:
out.append(str(temp.value))
temp=temp.next
out=’n’.join(out)
return (‘Top:{}nStack:n{}’.format(self.top,out))
__repr__=__str__
def isEmpty(self):
#write your code here
if self.top == None:
return True
else:
return False
def __len__(self):
#write your code here
self.count = 0
tempNode = self.top
while tempNode:
tempNode = tempNode.next
self.count+=1
return self.count
def peek(self):
#write your code here
return self.top.value
def push(self,value):
#write your code here
if self.top is None:
self.top