原创 LeetCode OJ刷題歷程——Contains Duplicate

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value a

原创 LeetCode OJ刷題歷程——Maximum Depth of Binary Tree

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

原创 《STL源碼剖析》之Traits

不論是泛型思維或STL的實際運用,迭代器都扮演着重要的角色。STL的中心思想在於:將數據容器和算法分開,彼此獨立設計,最後再以一帖強力膠將他們粘在一起。容器和算法的泛型化,從技術角度來看,並不困難,C++的 class templates

原创 《STL 源碼剖析》之空間配置器

首先,這個爲什麼叫“空間配置器”而不叫“內存配置器”呢?因爲空間不一定是內存,也可以是磁盤或者其它存儲介質。 下面我們來看一段代碼: class Foo{ ... }; Foo *p = new Foo; delete p;這在C+

原创 《深入探索C++對象模型》第二章:構造函數語意學(上)

1、Default Constructor的構造操作 default constructor什麼時候會被合成?——在被需要的時候......那麼是誰需要呢?需要做什麼呢? 書中說不是程序需要,而是編譯器需要,程序如果有需要,那是程序員的責

原创 LeetCode OJ刷題歷程——Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Give

原创 LeetCode OJ刷題歷程——Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 以上是題目要求。 本題較爲Easy,但是值得注意的

原创 muduo網絡庫源碼解析 七

這一章節,我們來分析多線程TcpServer,首先分析muduo one loop per thread的基石——EventLoopThread class,EventLoopThread會啓動自己的線程,並在其中運行EventLoop:

原创 ExtJS 4 grid 帶參數 查詢 分頁 store beforeload 解決辦法

這尼瑪,寫這個的時候 網上看了很多例子,都不能用,最後看到這個.....轉給大家看看。 先上核心代碼,恍然大悟的直接去修改代碼吧! store.on('beforeload', function (store, options) { v

原创 LeetCode OJ刷題歷程——Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head. Given linked list: 1->2->3->4->5, an

原创 LeetCode OJ刷題歷程——Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 以上爲題目要求。 首先說說這個題目我的解題思路,首先找出st

原创 LeetCode OJ刷題歷程——Nim Game

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you

原创 LeetCode OJ刷題歷程——Move Zeroes

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

原创 LeetCode OJ刷題歷程——Two Sum

Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. You may assume that ea

原创 一個月學習規劃(9.20-11.0)

1、 Java編程思想看完 2、Muduo源碼分析看完 3、Leetcode每天兩道題 點贊 1 收藏 分享 文章舉報 徐九五 發佈了40 篇原創文章 · 獲贊 16 · 訪問量