原创 leet code -- Divide Two Integers

Q: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 分析

原创 深度探索C++對象模型--Function語意學

成員函數調用方式 Nonstatic Member Function(非靜態成員函數) -Nonstatic Member Function設計準則:與一般非成員函數(nonmember function)有相同的執行效率。因此,

原创 第六章堆排序之“用最小堆將k個已排序鏈表合併爲一個排序鏈表”(練習6.5-8)

出處:http://blog.csdn.net/MichealTX/article/details/7172910 問題:請給出一個時間爲O(nlgk),用來將k個已排序鏈表合併爲一個排序鏈表的算法。此處的n爲所有輸入鏈表中元素的總數

原创 vfork掛掉的一個問題

轉自:http://coolshell.cn/articles/12103.html#more-12103   作者:陳皓 在知乎上,有個人問了這樣的一個問題——爲什麼vfork的子進程裏用return,整個程序會掛掉,而且exit

原创 字符串子序列數目

出處:http://blog.csdn.net/sdjzping/article/details/13298343 1、http://acm.fzu.edu.cn/problem.php?pid=2129 2、題目大意: 給定一個

原创 leetcode -- Maximum Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For examp

原创 虛函數和純虛函數的區別

出處:http://blog.csdn.net/hackbuteer1/article/details/7558868 首先:強調一個概念 定義一個函數爲虛函數,不代表函數爲不被實現的函數。 定義他爲虛函數是爲了允許用基類的指針來調用子類

原创 動態規劃-最長迴文子序列

出處:http://www.acmerblog.com/longest-palindromic-subsequence-5721.html 給一個字符串,找出它的最長的迴文子序列的長度。例如,如果給定的序列是“BBABCBCAB”

原创 leetcode -- Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1 is read of

原创 leetcode -- Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list:

原创 數據源和連接池DataSource Objects and Connection Pools

https://docs.oracle.com/javaee/6/tutorial/doc/bncjj.html DataSource Objects and Connection Pools To store, organi

原创 深度探索C++對象模型-Data語義學

Data Member佈局 同一個Access Section(private, public等)中,data member的順序按照聲明順序排列,但是沒有規定需要連續排序。同時編譯器可能會安插一些內部的data member(

原创 leetcode -- Search for a Range

Q:Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's r

原创 深度探索C++對象模型-構造函數語義學

default constructor構建 default constructors在編譯器需要的時候產生,區別於程序設計者的需要。以下程序進行說明: class A(public: int v;); void test(){

原创 Boyer-Moore算法

出處:http://blog.csdn.net/appleprince88/article/details/11881323 一.簡述         在當前用於查找子字符串的算法中,BM(Boyer-Moore)算法是當前有