苗火 Nicholas
[Python] Create linked list in python
2022-6-22 萧
class Node:
def __init__(self, dst = -1, cost = -1):
self.dst = dst
self.cost = cost
self.link = None


def image_to_graph(image):
print("ssss\n")
header = Node()
header.link = Node(1,1)
header.link.link = Node(2,2)

p = header

while( p != None):
print(" :", p.dst, p.cost, "\n")
p = p.link

print(" end\n")

image_to_graph(None)
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容