原创 改變世界的九種算法

密鑰算法: 對於網上銀行的交易信息,其實一直有點納悶,互聯網上我把銀行卡信息交給他。其他人應該也可以獲取,從而得到我的信息。 原來這種網站裏是採用了密鑰算法,所謂密鑰算法。舉個簡單的例子,有三個人在一間屋子裏,一個是pap,是你的朋友,一

原创 Pyhton實例,抓取百度詞條關於Python的內容(一)

1.基本結構 開發爬蟲實例: 1.1、步驟 1.1.1、確定目標:確定抓取哪個網站的哪些網頁的哪部分數據。本實例確定抓取百度百科python詞條頁面以及它相關的詞條頁面的標題和簡介。 1.1.2、分析目標:最重要,確定抓取

原创 Leetcode - 75 - sortColors

題目 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjac

原创 算法day04

小結: A: memset(*指針,false,sizeof(指針))——快速的置0; B:深度優先搜索的基本模型 void dfs(int step) { 判斷邊界 嘗試每一種可能 for(i=1;i<=n;

原创 Leetcode - 349 - Intersection of Two Arrays - 類型轉化,Stringint,objectint

題目: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2

原创 算法day05

先決條件: A: fscanf函數原型爲int fscanf(FILE*stream, constchar*format, [argument…]); 其功能爲根據數據格式(format)從輸入流(stream)中寫入數據(a

原创 Latex的常見錯誤

1、! Undefined control sequence. l.101   \subfigure                [Small Box with a Long Caption] 問題就是 \subfigure是一個未定義

原创 Pyhton實例,抓取百度詞條關於Python的內容(二)

直接上代碼 1.UrlManager 管理器 # coding:utf8 class UrlManager(object): #初始化,待爬取URL和已爬取URL def __init__(self):

原创 Leetcode - 283 - moveZeros

題目 Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of

原创 算法day03

1.POJ 1004 Financial Management printf("$%.2f",avg); 主要注意最後這個輸出格式,其他比較簡單。 2.POJ 1552 Double #include <stdio.h> #in

原创 Leetcode - 80 -removeDuplicates

題目 Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? For example, Given sorted

原创 算法day02

算法的第二天,複習一下搜索問題。 1.DFS void dfs(int step)//step表示站在第幾個盒子前 { int i; if(step==n+1)//如果站在第n+1個盒子面前,則表示前n個盒子已經

原创 MFC改變編輯框背景、字體、顏色等

1。長度限制OnInitDialog()中:m_edit1.SetLimitText(8);                           //m_edit1爲編輯框的成員變量或者CEdit*pEdt=(CEdit*)GetDlgI

原创 算法day06

1. POJ 1488 TEX Quotes Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 9046 Accepted: 4

原创 算法day07

1.UVA 10327 Flip Sort Sorting in computer science is an important part. Almost every problem can be solved effecie