摘要:
本文摘自:http://harlon.org/2018/06/20/database/ 深入理解MySQL底层实现 这里选用MySQL作为了解数据库的底层实现,这是因为MySQL是目前最常用的数据库,了解它的底层实现也基本上对目前大数据的数据库所用的技术会有一个大致的了解。数据库最主要的索引设计,了 阅读全文
摘要:
1 """ 2 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. 3 Note: A leaf is a node with no childr 阅读全文
摘要:
1 """ 2 In a special ranking system, each voter gives a rank from highest to lowest to all teams participated in the competition. 3 The ordering of te 阅读全文
摘要:
1 """ 2 Evaluate the value of an arithmetic expression in Reverse Polish Notation. 3 Valid operators are +, -, *, /. Each operand may be an integer or 阅读全文
摘要:
1 """ 2 Given a linked list, determine if it has a cycle in it. 3 To represent a cycle in the given linked list, we use an integer pos which represent 阅读全文
摘要:
1.数据库,表,列,行,模式,每一列有唯一的数据类型,模式是数据库和表的布局及特性 2.满足主键的两个条件:任意两行都不具有相同的主键值,每行都必须具有主键值 3.SQL(Structured Query Languge)结构化查询语言 4.DBMS数据库管理系统,MySQL是一种DBMS,即他是一 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
1 """ 2 首先理解题意,因为要找结点的下个指针 3 不能从根节点来看。要从第二层看来判断 4 找到规律自然用递归写法 5 """ 6 class Node: 7 def __init__(self, val: int = 0, left: 'Node' = None, right: 'Node 阅读全文