1.Two Sum 這題剛開始想用O(N)的方法,但是發現如果用數組標記 [ target-numbers[i] ] 的話,可能會有負數的情況,所以就兩個for迴圈想暴力看看能不能過的,一交發現T了。然後想了下,數組其實可以用map解決,把map當成數組用得了,可以標記負數的情況。java中也有,phthon還沒用過。 2.Remove Nth Node From End of List
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers in each column are sorted in ascending from
幾乎從來沒有認真學習過matlab現在開始好好學習 第一章、matlab基本介紹 怎麼安裝的這裡就不說了,我用的版本是R2012a,個人認為安裝的過程相當的簡單,幾乎一鍵式安裝。 之前偏愛在command視窗寫東西方法這樣的弊端太多,不已修改等等,所以上來就是M檔案吧 這裡簡單的給出這本書的幾個例子吧 %this program is about area%and display the resultradius = 2.5;area =
現在有幾種調用webservice的方法,總結一下: 1、 stub方式。這種方式,是利用axis的WSDL2Java工具類。這個是根據webservice的wsdl產生用戶端類。這樣就可以像是在調用本地的類一樣來調用webservice,很簡單。需要一個批處理,如下: set Axis_Lib=E:\jar\axis-bin-1_4\axis-1_4\lib set Java_
.\Obj\Templet.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST. 在使用KEIL4編譯串連工程時一直出現這個錯誤,有點奇怪;devices用的是 32F101RB,開機檔案用的是.mds, 因此
One Edit Distance Total Accepted: 709 Total Submissions: 3097 Given two strings S and T, determine if they are both one edit distance apart. [分析] delete, add, replace 三種都是 One edit distance. delete 和add 兩個string長度差1,
題目: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before coding. Bonus points for
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 題目解析: 用數組表示的數字,將其+1,得到結果。跟Add Binary一樣,加上後進位。但容器的話,插入要用insert函數。