原创 Linked List Cycle
題目 Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 分析
原创 匈牙利命名法
http://hi.baidu.com/chaosaco/item/68573af2e7dd1610d7ff8ce6 a Array
原创 自定義map比較規則及函數調用
參考文章:http://blog.csdn.net/challenge_c_plusplus/article/details/7429963 注意: 1、比較函數中形參爲常量引用, 即const string & 形式。 2、typede
原创 Single Number
題目 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorith
原创 Single Number II
位運算,異或(EOR) 題目 Given an array of integers, every element appears three times except for one. Find that single one.
原创 Path Sum
path-sum 遞歸: 如果使用遞歸,需要明確遞歸的結束條件,結束條件分爲幾類。遞歸的模式爲: Type f(...) { if 滿足結束條件1 return x; if 滿足結束條件2
原创 PAT系列索引
1~10 1002. A+B for Polynomials http://blog.csdn.net/staibin/article/details/19928719 1003. Emergency<Dijstra><多條最短路徑>
原创 LRU Cache
題目 Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operati
原创 杭電ACM分類
基礎題:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、
原创 Linked List Cycle II
題目 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can yo