原创 LeetCode--4. Median of Two Sorted Arrays

4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the m

原创 Python時間序列分析--從線性模型到GARCH模型

四級渣渣看個英文文章簡直就是自虐,一天只能看一點,還只能看個半懂。唉,寫下來以後慢慢理解改正吧。 目錄 一、Motivation 二、基礎知識 1.平穩性 2.序列相關(自相關) 3.爲什麼我們關心

原创 Python之pandas基礎

Pandas 是基於 Numpy 構建的含有更高級數據結構和工具的數據分析包,類似於 Numpy 的核心是 ndarray,pandas 的兩個主要數據結構是 Series 和 DataFrame 。 from pandas im

原创 大數相加問題

</pre><pre name="code" class="cpp">#include "stdafx.h" #include <string> #include <iostream> using namespace std; int

原创 LeetCode--1. Two Sum

1.Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target.

原创 HDU 4791 Alice’s Print Service

題目: Alice’s Print Service Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Tota

原创 hash_map/unordered_map原理和使用

轉載地址:http://blog.csdn.net/blues1021/article/details/45054159 1.結論 運行效率方面:unordered_map最高,hash_map其次,而map效率最低單提供了

原创 LeetCode--328.Odd Even Linked List

328. Odd Even Linked List Given a singly linked list, group all odd nodes together followed by the even nodes. Please

原创 Python數據加載、存儲與文件格式

數據加載、存儲與文件格式 1.讀寫文本格式數據 Pandas中的解析函數: read_csv 從文件、URL、文件型對象中加載帶分隔符的數據,默認分隔符爲逗號 read_table 從文件、URL、文件型對象中加載帶分隔

原创 Linux命令--cd

cd命令用來切換工作目錄至dirname。 其中dirName表示法可爲絕對路徑或相對路徑。若目錄名稱省略,則變換至使用者的home directory(也就是剛login時所在的目錄)。另外,~也表示爲home directory的意思

原创 Backtracking回溯法(又稱DFS,遞歸)全解

回溯是啥 用爬山來比喻回溯,好比從山腳下找一條爬上山頂的路,起初有好幾條道可走,當選擇一條道走到某處時,又有幾條岔道可供選擇,只能選擇其中一條道往前走,若能這樣子順利爬上山頂則罷了,否則走到一條絕路上時,只好返回到最近的一個路口,重新選擇

原创 梯度下降算法及Python實現

梯度下降是一個用來求函數最小值的算法,其背後的思想是:開始時我們隨機選擇一個參數的組合,計算代價函數,然後我們尋找下一個能讓代價函數值下降最多的參數組合。我們持續這麼做直到到達一個局部最小值,因爲我們並沒有嘗試完所有的參數組合,所以不能確

原创 Hadoop的Map-side join和Reduce-side join

Hadoop中連接(join)操作很常見,Hadoop“連接”的概念本身,和SQL的“連接”是一致的。SQL的連接,在維基百科中已經說得非常清楚。比如dataset A是關於用戶個人信息的,key是用戶id,value是用戶姓名等等個人信

原创 LeetCode--112. Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along t

原创 LeetCode--111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the