原创 範式和反範式的優缺點

    在設計數據庫時,有範式和反範式的講究,下面總結一下。     範式的優點:     1)範式化的數據庫更新起來更加快;     2)範式化之後,只有很少的重複數據,只需要修改更少的數據;     3)範式化的表更小,可以在內

原创 3Sum——解題報告

    【題目】      Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique

原创 3Sum Closest ——解題報告

    【題目】     Given an array S of n integers, find three integers in S such that the sum is closest to a given number,

原创 數據庫設計中關於數據類型的優化

    在數據庫設計中,尤其在建表的時候,我們需要分別對每個字段確定對應的數據類型。那麼MySQL支持的數據類型非常多,選擇正確的、合理的數據類型對後面的查找速度有直接的影響。不管存儲哪種類型的數據,下面有幾個簡單的設計原則: 1、儘

原创 Integer to Roman ——解題報告

    【題目】     Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 399