原创 不使用任何額外變量判斷迴文數字(6行代碼)

不使用任何額外變量判斷迴文數字 Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. Notes

原创 尋找最長不重複子串

尋找最長不重複子串 Longest Substring Without Repeating Characters Given a string, find the length of the longest substring

原创 實現atoi函數(string轉integer)

實現atoi函數(string轉integer) String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefull

原创 查詢兩個數組的中位數

查詢兩個數組的中位數 Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. F

原创 手寫體數字識別例子

  mnist是一個大型的手寫體數字數據庫,廣泛應用於機器學習領域的訓練和測試。mnist對每張圖都已經進行尺寸歸一化,固定尺寸28像素x28像素。   下面開始手寫體的簡單例子測試caffe的安裝情況。(注:未編譯安裝caff

原创 Ubuntu14.04下深度學習框架Caffe的搭建

  隨着機器學習中神經網絡技術的發展,衍生出深度學習技術,前段google公司風頭一時無兩的“阿爾法狗”就是深度學習的產物。而Caffe就是一款優秀的易於學習的深度學習框架。Caffe本身由c++寫成,支持Java和Python接

原创 合併兩棵二叉樹(7 lines)

合併兩棵二叉樹 Merge Two Binary Trees Given two binary trees and imagine that when you put one of them to cover the other

原创 查找字符串最長迴文

查找字符串最長迴文 Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may ass

原创 手動實現.*正則表達式匹配函數

手動實現.*正則表達式匹配函數 regular expression matching '.' Matches any single character. '*' Matches zero or more of the prec

原创 驗證大小中括號是否成對閉合匹配

驗證大小中括號是否成對閉合匹配 Valid Parentheses 驗證大小中括號是否成對閉合匹配。 Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘

原创 移除鏈表倒數第n個元素

移除鏈表倒數第n個元素 Remove Nth Node From End of List 給定一個鏈表,移除倒數第n個元素,返回鏈表頭部。 Given a linked list, remove the nth node from th

原创 移除數組中的重複元素

移除數組中的重複元素 Remove Duplicates from Sorted Array 給定一個數組,移除數組中的重複元素,返回新數組的長度,不允許開闢新的數組空間,只能在原數組內存中完成。 題目原文: Given a sor

原创 構造n個成對括號

構造n個成對括號 Generate Parentheses 給出一個整數n,實現一個函數生成n對小括號,n對小括號的左右括弧順序不限,但應該閉合。 Given n pairs of parentheses, write a functi

原创 成對交換鏈表節點

成對交換鏈表節點 Swap Nodes in Pairs 給定一個鏈表,成對交換兩個節點,返回新鏈表的頭部,不允許使用額外的內存,只能在原有鏈表節點基礎上進行操作。 Given a linked list, swap every two

原创 兩數相除——不允許使用高級運算

兩數相除——不允許使用高級運算 Divide Two Integers 實現兩整數相除,不允許使用乘法、除法、和取餘運算。 如果結果溢出(int範圍爲-2147483648 ~ 2147483647),返回MAX_INT 題目原文: