摘要:
``` class ListNode: def __init__(self, data): self.data = data self.next = None @classmethod def deletenodeo1(cls, pheadNode, pToBedeleted): # 1.如果链表只有一个节点 # 2.如果删除的节点是链表的尾节点 # 3.多节点:把当前给定节点的next的data 阅读全文
摘要:
``` #主要是考虑边界情况 def power(base, exponent): if base == 0 and exponent < 0: return 0 absexponent = exponent if exponent < 0: absexponent = -exponent result = powerWithExponent(base, absexponent) if expon 阅读全文