原创 2 由分治(Divide&Conquer)通向歸併排序(MergeSort)

由分治(Divide&Conquer)通向歸併排序(MergeSort) 一個求數組中的最大值的分治實現: /* * @Descripttion: * @version: * @Author: iDestro * @D

原创 A1011 World Cup Betting (20分)

With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best playe

原创 1 基礎排序

基礎排序 交換函數 void swap(int arr[], int i, int j) { int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; }

原创 A1018 Public Bike Management (30分)

There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the worl

原创 5 互斥量概念、用法、死鎖演示及解決詳解

5 互斥量概念、用法、死鎖演示及解決詳解 文章目錄5 互斥量概念、用法、死鎖演示及解決詳解5.1 互斥量(mutex)的基本概念5.2 互斥量的用法5.2.1 lock(), unlock()代碼5-2-1運行結果5.2.2 st

原创 CCF認證刷題-201412-2-Z字形掃描

分析: ​ 這道題的難點主要是控制邊界,觀察題目給的路徑可以看出,有兩個掃描的方向,斜向上與斜向下,我這裏用enumenumenum類型變量存儲方向,初始點爲(0,0)(0,0)(0,0),方向爲斜向上,先打印出訪問

原创 A1008 Elevator (20分)

The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers

原创 LeetCode刷題-206. Reverse Linked List(反轉鏈表)

反轉一個單鏈表。 示例: 輸入: 1->2->3->4->5->NULL 輸出: 5->4->3->2->1->NULL 進階: 你可以迭代或遞歸地反轉鏈表。你能否用兩種方法解決這道題? 解法一: 逆序可以考慮堆棧,先遍歷整個鏈

原创 A1028 List Sorting (25分)

Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Eac

原创 Python shutil模塊常用函數詳解

Python shutil模塊常用函數詳解 文章目錄Python shutil模塊常用函數詳解目錄及文件操作copyfileobj(*fsrc, fdst*[*, length*])copyfile(*src, dst, \*,

原创 2 線程啓動、結束,創建線程方法,join、detach

2 線程啓動、結束,創建線程方法,join、detach 文章目錄2 線程啓動、結束,創建線程方法,join、detach2.1 範例演示線程運行的開始和結束代碼2-1-1運行結果2.1.1 居然直接報錯了,這是爲什麼呢?2.1

原创 A1019 General Palindromic Number (20分)

A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example,

原创 A1010 Radix (25分)

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 i

原创 A1021 Deepest Root (25分)

A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. N

原创 A1007 Maximum Subsequence Sum (25分)

Given a sequence of K integers { N​1​​, N​2​​, ..., N​K​​ }. A continuous subsequence is defined to be { N​i​​, N​i+1​​