Given a non-empty string str and an integer k, rearrange the string such that the same characters are at least distance k from each other. All input s ...
分类:
其他好文 时间:
2016-06-15 01:46:08
阅读次数:
298
题目描述: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,- ...
分类:
其他好文 时间:
2016-06-14 17:32:36
阅读次数:
142
Most Significant Bit, Last(Least) Significant Bit 最高有效位(MSB) 指二进制中最高值的比特。在16比特的数字音频中,其第1个比特便对16bit的字的数值有最大的影响。例如,在十进制的15,389这一数字中,相当于万数那1行(1)的数字便对数值的影 ...
分类:
其他好文 时间:
2016-06-13 21:59:08
阅读次数:
179
1. LRU1.1. 原理 LRU(Least recently used,最近最少使用)算法根据数据的历史访问记录来进行淘汰数据,其核心思想是“如果数据最近被访问过,那么将来被访问的几率也更高”。 1.2. 实现 最常见的实现是使用一个链表保存缓存数据,详细算法实现如下: 1. 新数据插入到链表头 ...
分类:
编程语言 时间:
2016-06-13 18:52:15
阅读次数:
320
目的:保持直流平衡DC Balance)。 running disparity() 8bit原始数据会分成两部分,其低5位会进行5B/6B编码,高3位则进行3B/4B编码,这两种映射关系在当时已经成为了一个标准化的表格。 人们喜欢把8bit数据表示成Dx.y的形式,其x=5LSB(least sig ...
分类:
其他好文 时间:
2016-06-13 15:23:19
阅读次数:
126
这是一道非常高频,非常经典的题目: 首先分析下题意: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get ...
分类:
系统相关 时间:
2016-06-12 21:46:17
阅读次数:
156
Quick Brown Fox时间限制: 1 Sec 内存限制: 128 MB 题目描述 A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . .‘z’. You’r ...
分类:
其他好文 时间:
2016-06-11 11:49:00
阅读次数:
232
最近在看Leveldb源码,里面用到LRU(Least Recently Used)缓存,所以自己动手来实现一下。LRU Cache通常实现方式为Hash Map + Double Linked List,我使用std::map来代替哈希表。 实现代码如下: ...
分类:
系统相关 时间:
2016-06-10 14:59:30
阅读次数:
336
题目描述 A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . .‘z’. You’re probably familiar with this one: “The ...
分类:
其他好文 时间:
2016-06-09 21:03:24
阅读次数:
264
报错信息如下:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program ...
分类:
其他好文 时间:
2016-06-08 13:58:00
阅读次数:
115