Leetcode
一条咸狗
这个作者很懒,什么都没留下…
展开
-
Leetcode: Linked List
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None 206 反转链表 class Solution: def reverseList(self, head): ...原创 2019-02-26 17:31:54 · 199 阅读 · 0 评论 -
Leetcode: Tree
定义 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None 102. 二叉树的层次遍历 有两种思路,BFS和DFS,时间复杂度都...原创 2019-02-26 17:34:42 · 247 阅读 · 0 评论