CHuiL

337. House Robber III

leetcode

题目 The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. After ...

k8s核心概念

k8s学习记录

Kubernetes(k8s)简介 用于容器集群管理;功能包括:资源调度、容器发布、状态监控、弹性扩缩容、滚动更新、故障恢复、服务发现、负责均衡等 集群组件架构为主-从架构 Pod(容器组) pod是Kubernetes的最基本概念,一个pod中可以放多个耦合度高的容器(或者说是紧密联系的容器),或者是一个容器(通常都是一个pod一个容器); pod的IP为PodIP,两个Pod可以直接...

drop、delete与truncate的区别

Delete 与 Truncate Delete与Truncate都是删除表中的数据 Delete执行后会在事务日志中保存记录以便回滚,而Truncate则不会记录。所以是不能恢复的 表和索引所占空间。当表被Truncate后,这个表和索引所占用的空间会恢复到初始大小。而Delete操作不会减少表或索引所占用的空间 Truncate与不带where的delete:都是删除表...

go的内存分配与回收

go学习记录

Golang 的内存管理本质上就是一个内存池; 分配 内存池 mheap Golang在启动的时候会像内存申请一大块内存作为内存池,这块内存池池会放在一个叫mheap的结构体中管理;mheap负责将这一整块内存切割成不同的区域,并将其中一部分的内存切割成合适的大小,分配给使用; 我们需要先知道几个重要的概念: page:内存页,8k大小,Go与操作系统之间的内存申请和释放都...

go channel原理介绍

go学习记录

channel 名为通道,主要用于goroutine之间的通信; 他有收发两方,发送者可以向通道发送数据,如果通道里面的数据还没有被取走,那么发送方将阻塞;接受者也是同样,可以从通道里拿去数据,如果没有数据,也会阻塞;通道可以被关闭,如果发送者尝试向一个已经关闭了的通道发送数据,那么将会触发panic,接受者如果尝试从已关闭的通道中获取数据时,那么会返回对应类型的零值和False; cha...

11. Container With Most Water-贪心

leetcode

题目 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...

55. Jump Game

leetcode

题目 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine...

380. Insert Delete GetRandom O(1)

leetcode

题目 Design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already present. remove(val): Removes an item val from th...

334. Increasing Triplet Subsequence

leetcode

题目 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if there exists i, j, k such that arr[i] ...

300. Longest Increasing Subsequence

leetcode

题目 Given an unsorted array of integers, find the length of longest increasing subsequence. 题意 给定无序整型数组,求出递增序列长度(该序列不一定连续) 例子 Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest incre...