原创 TCP/IP協議詳解:卷一 第一章

第一章 一、TCP/IP協議簇的四層協議    1.         一般來說,下面三層一般在操作系統內核中執行,而應用層在通常是用戶的一個進程。應用層關心的是應用程序的細節而不是數據在網絡中的傳輸活動。下面三層則對應用程序一無所知,但他

原创 leetcode Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 思想很簡單,就是邊界問題的處理,採用了re=strs[0],避免

原创 leetcode Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible pal

原创 三十分鐘 掌握STL

譯者:kary contact:[email protected] STL概述 STL的一個重要特點是數據結構和算法的分離。儘管這是個簡單的概念,但這種分離確實使得STL變得非常通用。例如,由於STL的sort()函數是完全通

原创 leetcode 回溯法 模板

/** * dfs 模板. * @param[in] input 輸入數據指針 * @param[out] path 當前路徑,也是中間結果 * @

原创 深入探索C++對象模型 第七章 站在對象模型的尖端

主要探討的有三個問題:template、異常處理、執行期類型識別 A.       Template 定義一個template(模板定義域) Template<class  T> Class point{          Public:

原创 leetcode Construct Binary Tree from Inorder and Postorder Traversal

Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do n

原创 leetcode 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target.

原创 leetcode Add Binary

Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". class

原创 leetcode Combination Sum

Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate nu

原创 深入探索C++對象模型 第六章 執行語義學

1.        一個區段可能有多個return離開點,所以可能導致一些對象創建後,沒有用就需要釋放,這就造成了很多浪費。所以建議把object放置在使用它的區段的附近。 2.        C++中全局變量會放置在datasegmen

原创 leetcode Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit t

原创 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

原创 TCP/IP 第三章 IP:網際協議

一、IP介紹 IP協議是TCP/IP協議簇中最爲核心的協議。所有TCP,UDP,ICMP,IGMP都是以IP數據報格式傳輸。 IP協議有兩個特點需要注意:不可靠和無連接 不可靠:說的是IP協議不能保證IP數據報能夠成功的到達目的地。如果

原创 leetcode Binary Tree Zigzag Level Order Traversal

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right