摘要:        
方法一:用HashMap, map里面存元素及其出现次数。维护一个最大长度。用两个指针,右指针一直走到出现3个dinstinct character为止。然后调整左指针删元素,直接从左往右逐个字符的删除,一直删到某个字符不会再出现。判断字符被删光就看次数是否减为了0. 采用方法: 这里每个元素都会进    阅读全文
posted @ 2015-01-22 13:17
neverlandly
阅读(400)
评论(0)
推荐(0)
            
        
        
摘要:        
这道题跟I不一样在于,read函数可能多次调用,比如read(buf,23)之后又read(buf, 25), 第一次调用时的buffer还没用完,还剩一个char在buffer里,第二次拿出来接着用,这样才能保证接着上次读的地方继续往下读。 1. 所以应该设置这4个char的buffer为inst    阅读全文
posted @ 2015-01-22 07:35
neverlandly
阅读(2821)
评论(0)
推荐(0)
            
        
        
摘要:        
What is a stack overflow error?Parameters and local variables are allocated on the stack (with reference types the object lives on the heap and a vari...    阅读全文
posted @ 2015-01-22 06:47
neverlandly
阅读(338)
评论(0)
推荐(0)
    
                    
                
浙公网安备 33010602011771号