数据库事务隔离级别,如何实现隔离。MySQL和Oracle默认的隔离级别
数据库B+树怎么存储
B+树
redis问了好多 都没有听说过
TCP 为什么挥手四次 握手三次?挥手的 wait???
a = {"key": 1} b = a b["key"] = 2 print b print a
class Solution:
def detectCycle(self , head ):
# write code here
slow = head
fast = head
while (fast and fast.next):
slow = slow.next
fast = fast.next.next
if slow == fast:
break
else:
return None
cur = head
while (cur != slow):
cur = cur.next
slow = slow.next
return cur
# -*- coding:utf-8 -*-
import random
class Solution:
def findKth(self, a, n, K):
# write code here
def part(left, right, pivor_index):
pivot = a[pivot_index]
a[pivot_index], a[right] = a[right], a[pivot_index]
tmp = left
for i in range(left, right):
if a[i] < pivot:
a[tmp], a[i] = a[i], a[tmp]
tmp += 1
a[right], a[tmp] = a[tmp], a[right]
return tmp
def choose_pivot(left, right, res):
pivot_index = random.randint(left, right)
pivot_index = part(left, right, pivot_index)
if res == pivot_index:
return a[res]
elif res < pivot_index:
return chooes_pivot(left, pivot_index - 1, res)
else:
return choose_pivot(pivot_index + 1, right, res)
return choose_pivot(0, n, n - K)
小偷来到一条街上偷东西,从街头偷到街尾,中间如果相连两家发生失窃,会自动报警,注意报警后小偷到手的钱还算数。请问小偷所能偷到的钱的最大值是多少?
def rob(nums):
n = len(nums)
dp1 = [0] * n
dp2 = [0] * n
if n == 1:
return nums[0]
for i in range(n):
flag = 0
if dp1[i-2] + nums[i] > dp1[i-1]:
flag = 1
dp1[i] = max(dp1[i-2] + nums[i], dp1[i-1])
if flag == 0:
dp2[i] = dp2[i-1]
else:
dp2[i] = dp1[i-1] + nums[i]
return max(dp1[-1], dp2[-1])
l = [3, 5, 6]
res = rob(l)
print(res)
应该是个主管吧,对我一通暴捶教做人,字节是我不配,前前后后面了三四次了吧,应该最后一次了。
TCP拥塞控制
进程线程
命令行kill PID发生什么,怎么kill,怎么跟这个进程通信的
虚拟内存
栈内存,堆内存
要回的很深才行 不深不满意lol