改进到O(n)
- hash table
- bit manipulation
- two pointers(i,j在首,或者i, j 一头一尾)
- dp 或者greedy
见gas station https://leetcode.com/problems/gas-station/. 不需要 在i ==0不满足条件之后,继续试探i == 1, 试探i == k + 1即可
改进到O(nlogn)
- binary search
- sort
mb649b884ce232e 博主文章分类:leetcode ©著作权
见gas station https://leetcode.com/problems/gas-station/. 不需要 在i ==0不满足条件之后,继续试探i == 1, 试探i == k + 1即可
1. 缓存的收益和成本 缓存的收益: 1)加速读写:缓存通常都是全内存的,通过缓存的使用可以有效地加速读写,优化用户体验。 2)降低后端负载:帮助后端减少访问量,降低了后端的负载。 缓存成本: 1)数据不一致性:缓存层和存储层的数据存在着一定时间窗口的不一致性,时间窗口
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M