linux

linux的体系结构


redis

为什么redis能这么快

100000+qps

  • 完全基于内存,绝大部分请求是纯粹的内存操作
  • 数据结构简单,键值对,查找的时间复杂度是O(1)
  • 采用单线程,单线程也能处理高并发请求,想多核也可启动多实例(单线程只是处理网络请求的时候是单线程)
  • 使用多路I/O复用模型,非阻塞IO

20.二叉树的遍历


19.二叉搜索树_最近公共祖先:leetcode235

problem

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”


19.二叉树_最近公共祖先:leetcode236

problem

Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”


18.验证二叉搜索树:leetcode-98 Search Tree

problem

Given a binary tree, determine if it is a valid binary search tree (BST).

Assume a BST is defined as follows:

The left subtree of a node contains only nodes with keys less than the node’s key.
The right subtree of a node contains only nodes with keys greater than the node’s key.
Both the left and right subtrees must also be binary search trees.


数据库

数据库架构

如何设计一个关系型数据库

首先将其划分为存储部分和对存储进行逻辑管理的程序实例,存储部分类似一个文件系统,程序实例将包含数据逻辑关系转为物理存储关系的存储管理模块,优化存储效率的缓存模块,将sql语句进行解析的sql解析模块,记录操作的日志管理模块,进行多用户管理的权限划分模块,容灾模块,优化数据查询的索引模块,使数据库支持并发的锁模块。


网络

网络基础知识

OSI开发式互联参考模型


17.树和图

树是特殊化的链表


leetcode 15. 3Sum

problem

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.


Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×