上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: 208. Implement Trie (Prefix Tree) Medium A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve k 阅读全文
posted @ 2021-11-21 00:35 xiaoyongyong 阅读(137) 评论(0) 推荐(0)
摘要: 239. Sliding Window Maximum Hard You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of th 阅读全文
posted @ 2021-11-10 09:50 xiaoyongyong 阅读(78) 评论(0) 推荐(0)
摘要: 496. Next Greater Element I The next greater element of some element x in an array is the first greater element that is to the right of x in the same 阅读全文
posted @ 2021-11-05 11:59 xiaoyongyong 阅读(94) 评论(0) 推荐(0)
摘要: 215. Kth Largest Element in an Array Given an integer array nums and an integer k, return the kth largest element in the array. Note that it is the kt 阅读全文
posted @ 2021-10-27 23:35 xiaoyongyong 阅读(156) 评论(0) 推荐(0)
摘要: 悲观锁和乐观锁 可以举个例子:A进程和B进程同时在更新一个balance A进程要对balance扣减20,B进程要对balance扣减15 如何保证balance更新准确? 加悲观锁 悲观锁悲观的认为很有可能会有冲突,所以我们要先加锁比较好 所有的进程/线程在更新前先加锁,加锁成功后再进行更新/提 阅读全文
posted @ 2021-10-27 08:48 xiaoyongyong 阅读(67) 评论(0) 推荐(0)
摘要: 35. Search Insert Position Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the i 阅读全文
posted @ 2021-10-24 02:53 xiaoyongyong 阅读(258) 评论(0) 推荐(0)
摘要: 什么是raft? raft 是一种保证系统高可用的解决方案 如下图,假如我们有1个master和2个slave节点,形成主备 那么问题来了,如果Master节点宕掉了怎么办? 先简单说一下raft是怎么工作的,raft不是一个注册中心,而只是一个组件,它包含1个logtrace,用来记录最新状态 下 阅读全文
posted @ 2021-10-21 11:32 xiaoyongyong 阅读(226) 评论(0) 推荐(0)
摘要: Backtracking can be solved always as follows: Pick a starting point. while(Problem is not solved) For each path from the starting point. check if sele 阅读全文
posted @ 2021-10-18 00:01 xiaoyongyong 阅读(136) 评论(0) 推荐(0)
摘要: 127. Word Ladder Hard A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 阅读全文
posted @ 2021-10-11 00:14 xiaoyongyong 阅读(140) 评论(0) 推荐(0)
摘要: 15. 3Sum Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] 阅读全文
posted @ 2021-10-10 23:26 xiaoyongyong 阅读(69) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页