数据库隔离级别

SQL标准规范中定义了四种数据库隔离级别。每种隔离级别带来的系统开销是不一样的。通常较低的隔离级别的系统开销会更低,可以执行更高的并发。

READ COMMITTED(未提交读)

顾名思义,未提交读隔离级别中,事物的修改即使没有提交,对其他事务也是可见的。事务可以读取为未提交的数据,也成为脏读。READ COMMITED 性能上不会有跟很大的优势,但是却会导致很多的问题,在实际应用中很少使用。

阅读全文

算法-螺旋矩阵

题目

英文

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

阅读全文

算法-全排列-46

题目

英文

Given a collection of distinct integers, return all possible permutations.

阅读全文

算法-最接近的三数之和-16

题目

英文

Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution.

阅读全文

算法-盛水最多的容器

题目

英文

11. Container With Most Water
Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.

阅读全文

算法-三数之和

题目

英文

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.

阅读全文

算法-求两个有序链表的中位数

题目

英文

4. Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.

阅读全文

算法-水壶问题

问题

英文

You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two jugs.

阅读全文

算法-俄罗斯套娃问题

题目

英文

You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.

阅读全文

算法-求第k个排序

题目

英文

The set [1,2,3,…,n] contains a total of n! unique permutations.

阅读全文