上一页 1 2 3 4 5 6 7 8 ··· 43 下一页

2020年11月22日

一致性Hash算法(原创发布于慕课网)

摘要: 一致性哈希算法在1997年由麻省理工学院的Karger等人在解决分布式Cache中提出的,设计目标是为了解决因特网中的热点(Hot spot)问题,初衷和CARP十分类似。一致性哈希修正了CARP使用的简单哈希算法带来的问题,使得DHT可以在P2P环境中真正得到应用。 但现在一致性hash算法在分布 阅读全文

posted @ 2020-11-22 10:03 wsw_seu 阅读(77) 评论(0) 推荐(0) 编辑

2020年11月21日

279. Perfect Squares(dp)

摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = 12 O 阅读全文

posted @ 2020-11-21 22:18 wsw_seu 阅读(71) 评论(0) 推荐(0) 编辑

2020年11月18日

283. Move Zeroes(双指针)

摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: 阅读全文

posted @ 2020-11-18 23:17 wsw_seu 阅读(50) 评论(0) 推荐(0) 编辑

287. Find the Duplicate Number

摘要: Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one duplicate number in n 阅读全文

posted @ 2020-11-18 23:15 wsw_seu 阅读(96) 评论(0) 推荐(0) 编辑

2020年11月15日

289. Game of Life

摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文

posted @ 2020-11-15 13:22 wsw_seu 阅读(94) 评论(0) 推荐(0) 编辑

315. Count of Smaller Numbers After Self(二分或者算法导论中的归并求逆序数对)

摘要: You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文

posted @ 2020-11-15 11:00 wsw_seu 阅读(84) 评论(0) 推荐(0) 编辑

2020年11月11日

dp:322. Coin Change 自下而上的dp

摘要: You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文

posted @ 2020-11-11 21:56 wsw_seu 阅读(103) 评论(0) 推荐(0) 编辑

2020年11月8日

328. Odd Even Linked List

摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文

posted @ 2020-11-08 19:39 wsw_seu 阅读(54) 评论(0) 推荐(0) 编辑

329. Longest Increasing Path in a Matrix(核心在于缓存遍历过程中的中间结果)

摘要: Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do 阅读全文

posted @ 2020-11-08 11:58 wsw_seu 阅读(88) 评论(0) 推荐(0) 编辑

451. Sort Characters By Frequency(桶排序)

摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twi 阅读全文

posted @ 2020-11-08 10:48 wsw_seu 阅读(63) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 43 下一页

导航