本文整理汇总了Python中ListNode.ListNode.print_ll方法的典型用法代码示例。如果您正苦于以下问题:Python ListNode.print_ll方法的具体用法?Python ListNode.print_ll怎么用?Python ListNode.print_ll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListNode.ListNode
的用法示例。
在下文中一共展示了ListNode.print_ll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test1
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test1():
n1 = ListNode(1)
n3 = ListNode(3)
n2 = ListNode(2)
n4 = ListNode(4)
n14 = ListNode(14)
n18 = ListNode(18)
n7 = ListNode(7)
n9 = ListNode(9)
n11 = ListNode(11)
n13 = ListNode(13)
n1.next = n3
l1 = n1
n2.next = n4
n4.next = n14
n14.next = n18
l2 = n2
n7.next = n9
n9.next = n11
n11.next = n13
l3 = n7
lists = [l1, l2, l3]
rslt = mergeKLL(lists)
ListNode.print_ll(rslt)
示例2: test3
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test3():
n1 = ListNode(1)
n2 = ListNode(2)
n1.next = n2
ListNode.print_ll(reorderList(n1))
示例3: test3
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test3():
n1 = ListNode(1)
n2 = ListNode(2)
n2.next = n1
h = n2
rslt = mergeSort(h)
ListNode.print_ll(rslt)
示例4: test3
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test3():
n6 = ListNode(6)
n7 = ListNode(7)
n9 = ListNode(9)
n5 = ListNode(5)
n6.next = n7
n7.next = n9
ListNode.print_ll(addTwoNumbers(n6, n5, 0))
ListNode.print_ll(addTwoNumbersNoCarry(n6, n5))
示例5: test2
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test2():
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n3.next = n2
n2.next = n1
h = n3
rslt = mergeSort(h)
ListNode.print_ll(rslt)
示例6: test2
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test2():
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n4 = ListNode(4)
n1.next = n2
n2.next = n3
n3.next = n4
ListNode.print_ll(reorderList(n1))
示例7: test3
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test3():
n1 = ListNode(1)
n1a = ListNode(1)
n1b = ListNode(1)
n2a = ListNode(2)
n2b = ListNode(2)
n1.next = n1a
n1a.next = n1b
n1b.next = n2a
n2a.next = n2b
ListNode.print_ll(removeDupComp(n1))
示例8: test1
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test1():
n0 = ListNode(0)
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n4 = ListNode(4)
n0.next = n1
n1.next = n2
n2.next = n3
n3.next = n4
ListNode.print_ll(reorderList(n0))
示例9: test2
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test2():
n1 = ListNode(1)
n1a = ListNode(1)
n1b = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n1.next = n1a
n1a.next = n1b
n1b.next = n2
n2.next = n3
ListNode.print_ll(removeDupComp(n1))
示例10: test3
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test3():
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n4 = ListNode(4)
n5 = ListNode(5)
n6 = ListNode(6)
n1.next = n2
n2.next = n3
n3.next = n4
n4.next = n5
n5.next = n6
ListNode.print_ll(revKGrp(n1, 4))
示例11: test4
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test4():
l1 = ListNode(1)
l2 = ListNode(2)
l3 = ListNode(3)
l4 = ListNode(4)
l5 = ListNode(5)
l1.next = l2
l2.next = l3
l3.next = l4
l4.next = l5
ListNode.print_ll(l1)
ListNode.print_ll(removeNtoLast(l1, 2))
示例12: test1
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test1():
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n4 = ListNode(4)
n5 = ListNode(5)
n6 = ListNode(6)
n1.next = n2
n2.next = n3
n3.next = n4
n4.next = n5
n5.next = n6
#ListNode.print_ll(revKGrp(n1, 2))
ListNode.print_ll(revKGroup_r(n1, 1))
示例13: test2
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test2():
n1 = ListNode(1)
n2 = ListNode(2)
n3 = ListNode(3)
n4 = ListNode(4)
n5 = ListNode(5)
n6 = ListNode(6)
n1.next = n2
n2.next = n3
n3.next = n4
n4.next = n5
n5.next = n6
ListNode.print_ll(n1)
ListNode.print_ll(rotateLSegment(n1, 1, 4))
示例14: test1
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test1():
n1a = ListNode(1)
n1b = ListNode(1)
n1c = ListNode(1)
n2 = ListNode(2)
n3a = ListNode(3)
n3b = ListNode(3)
n3c = ListNode(3)
n1a.next = n1b
n1b.next = n1c
n1c.next = n2
n2.next = n3a
n3a.next = n3b
n3b.next = n3c
ListNode.print_ll(removeDup(n1a))
示例15: test6
# 需要导入模块: from ListNode import ListNode [as 别名]
# 或者: from ListNode.ListNode import print_ll [as 别名]
def test6():
n6 = ListNode(6)
n7 = ListNode(7)
n9 = ListNode(9)
n5 = ListNode(5)
n8 = ListNode(8)
n4 = ListNode(4)
n6.next = n7
n7.next = n9
n5.next = n8
n8.next = n4
ListNode.print_ll(addTwoNumbers(n6, n5, 0))
ListNode.print_ll(addTwoNumbersNoCarry(n6, n5))