摘要: 1.数据库,表,列,行,模式,每一列有唯一的数据类型,模式是数据库和表的布局及特性 2.满足主键的两个条件:任意两行都不具有相同的主键值,每行都必须具有主键值 3.SQL(Structured Query Languge)结构化查询语言 4.DBMS数据库管理系统,MySQL是一种DBMS,即他是一 阅读全文
posted @ 2020-02-28 19:20 yawenw 阅读(464) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 3 For this problem, a height-balanced binary 阅读全文
posted @ 2020-02-28 14:51 yawenw 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree, determine if it is a valid binary search tree (BST). 3 Assume a BST is defined as follows: 4 The left subtree of a node c 阅读全文
posted @ 2020-02-28 14:04 yawenw 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 自己AC 3 为了实现Z字形遍历 4 记录了二叉树的depth,如果depth为2的倍数 5 将得到的值reverse()处理一下再存入res中 6 """ 7 8 class TreeNode: 9 def __init__(self, x): 10 self.val = x 11 阅读全文
posted @ 2020-02-28 00:46 yawenw 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 首先理解题意,因为要找结点的下个指针 3 不能从根节点来看。要从第二层看来判断 4 找到规律自然用递归写法 5 """ 6 class Node: 7 def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node 阅读全文
posted @ 2020-02-28 00:44 yawenw 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. 3 In Pascal's triangle, each number is the sum of the t 阅读全文
posted @ 2020-02-28 00:42 yawenw 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Say you have an array for which the ith element is the price of a given stock on day i. 3 Design an algorithm to find the maximum profit. You 阅读全文
posted @ 2020-02-28 00:41 yawenw 阅读(113) 评论(0) 推荐(0) 编辑