原创 詳解char和varchar的區別

    MySQL中的字符串有兩個常用的類型:char和varchar,二者各有優勢,下面我們來詳細分析一下。 1、char(n)類型     char類型時定長的類型,即當定義的是char(10),輸入的是"abc"這三個字符時,它

原创 Linux中的head, tail,wc命令

    Linux系統中讀取文件還有幾個命令:head, tail, wc。我們解釋一下這幾個命令。 1. head:顯示前面幾行 head file:顯示1-10行(默認爲10行) head -n 20 file:顯示1-20行 h

原创 Generate Parentheses——解題報告

    【題目】     Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. F

原创 MySQL中整各種int類型的範圍和存儲大小

    MySQL中中的整數類型int主要有如下幾種:     tinyint 的範圍是-128~127;     int的範圍是-2^31 (-2,147,483,648) 到 2^31 – 1 (2,147,483,647) 的整型

原创 Valid Parentheses——解題報告

    【題目】     Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input str

原创 Letter Combinations of a Phone Number——解題報告 (回溯法的應用 )

    【題目】       Given a digit string, return all possible letter combinations that the number could represent. A mapp

原创 Container With Most Water ——解題筆記

   【題目】 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical

原创 Longest Common Prefix ——解題報告

    【題目】     Write a function to find the longest common prefix string amongst an array of strings.     【分析】      公共前

原创 Merge k Sorted Lists ——待解決TLE

    【題目】Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.     【分析】

原创 Merge Two Sorted Lists——解題報告

    【題目】     Merge two sorted linked lists and return it as a new list. The new list should be made by splicing togeth

原创 kSum問題的總結

    kSum問題是一類題型,常見的有2Sum,3Sum,4Sum等。這篇博文就來總結一些kSum問題的解法,以及對應的時間複雜度。     1. 2Sum     在一個給定的數組nums中,尋找和爲定值target的兩個數。  

原创 Swap Nodes in Pairs ——解題報告

    【題目】     Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, yo

原创 Palindrome Number ——解題筆記

    【題目】 Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints

原创 Roman to Integer ——解題報告

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

原创 Remove Nth Node From End of List ——解題報告

    【題目】     Given a linked list, remove the nth node from the end of list and return its head. For example, Given lin