原创 Leetcode 79:Word Search

題目鏈接: https://leetcode.com/problems/word-search/description/ 描述 Given a 2D board and a word, find if the word exist

原创 題目284:坦克大戰

題目鏈接: http://acm.nyist.net/JudgeOnline/problem.php?pid=284 描述 Many of us had played the game “Battle city” in our c

原创 題目36:數的長度

題目鏈接: http://acm.nyist.net/JudgeOnline/problem.php?cid=330&cpid=36 描述 N!階乘是一個非常大的數,大家都知道計算公式是N!=N*(N-1)······*2*1.現

原创 題目33:蛇形填數

題目鏈接: http://acm.nyist.net/JudgeOnline/problem.php?pid=33 描述 在n*n方陳裏填入1,2,…,n*n,要求填成蛇形。例如n=4時方陳爲: 10 11 12 1 9 16

原创 LeetCode 69: Sqrt(x)

題目鏈接: https://leetcode.com/problems/sqrtx/description/ 描述 Implement int sqrt(int x). Compute and return the square

原创 LeetCode 172: Factorial Trailing Zeroes

題目鏈接: https://leetcode.com/problems/factorial-trailing-zeroes/description/ 描述 Given an integer n, return the number of

原创 題目104:最大和

題目鏈接: http://acm.nyist.net/JudgeOnline/problem.php?pid=104 描述 給定一個由整數組成二維矩陣(r*c),現在需要找出它的一個子矩陣,使得這個子矩陣內的所有元素之和最大,並把這個子矩

原创 LeetCode 198: House Robber

題目鏈接: https://leetcode.com/problems/house-robber/description/ 描述 You are a professional robber planning to rob houses a

原创 《深入探索C++對象模型》之二

前言:       C++語言編譯過程中,編譯器會揹着程序員做了很多工作,其中默認構造函數就是其中一件工作,透徹熟悉C++默認構造函數在何種情形下會生成,以及其作用是什麼,對於C++程序員來是至關重要的。下面詳細介紹C++構造語意學。1、

原创 《深入探索C++對象模型》之一

前言:        由於經常使用C++,但是又對C++內部機制不是很深入瞭解,所以看了一些關於C++的經典書籍,其中有《C++ Primer》、《STL源碼剖析》、《Efficitive C++》、《More Efficitive C+

原创 LeetCode 235: Lowest Common Ancestor of a Binary Search Tree

題目鏈接: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/description/ 描述 Given a binary searc

原创 LeetCode 160: Intersection of Two Linked Lists

題目鏈接: https://leetcode.com/problems/intersection-of-two-linked-lists/description/ 描述 Write a program to find the node a

原创 LeetCode 169: Majority Element

題目鏈接: https://leetcode.com/problems/majority-element/description/ 描述 Given an array of size n, find the majority elemen

原创 LeetCode 121: Best Time to Buy and Sell Stock

題目鏈接: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/ 描述 Say you have an array for which the

原创 LeetCode 231: Power of Two

題目鏈接: https://leetcode.com/problems/power-of-two/description/ 描述 Given an integer, write a function to determine if it