原创 ubuntu配置tensorflow-gpu運行環境的配置

配置tensorflow-gpu需要安裝如下內容: cuda-driver : 顯卡驅動 cuda : 相當於是一種計算方法 cudnn :這個是一個工具,用來處理cuda的 tensorflow-gpu : 一定要是gpu版本

原创 算法:快速排序的實現

理解: 快速排序對問題分而治之的一種方法,在每一趟排序後,都能確定一個數的位置(即分割點),因此快速排序的核心是確定分割點的位置並把數組按大小分在分割點的兩側。 因此快排可以分爲兩部分,第一部分是遞歸處理問題,第二部分是找到分割點

原创 Search in Rotated Sorted Array

題目 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6

原创 leetcode刷題:Linked List Cycle II (鏈表循環 II) 詳解

原題 題目鏈接 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent

原创 Group Anagrams

題目 Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], O

原创 Combination Sum

題目 Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique c

原创 Palindromic Substrings

題目 Given a string, your task is to count how many palindromic substrings in this string. The substrings with differen

原创 機器學習(西瓜書)8.3式證明

書上列出了這個式子,但是沒有給出詳細的證明 根據書上的提示,找到Hoeffding的定義 對於二項分佈,有如下定義: 假設爲拋硬幣的情況,每次正面朝上的概率設爲p,拋n次硬幣,正面朝上次數不超過k次的概率爲: 對於ε > 0,當k

原创 DI String Match

題目 Given a string S that only contains “I” (increase) or “D” (decrease), let N = S.length. Return any permutation A o

原创 Find All Numbers Disappeared in an Array

題目 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear on

原创 uess Number Higher or Lower

題目 We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which numbe

原创 Find the Difference

題目 Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling stri

原创 Reverse Linked List

題目 Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL 總結 思路一:遞歸,從後往前反轉 代碼

原创 Palindrome Linked List

題目 Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Inp

原创 Count Primes

題目 Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: T