《枪炮、病菌与钢铁:人类社会的命运》书摘

前言 耶利的问题 对本书来说,这样的一句话就是:“不同民族的历史遵循不同的道路前进,其原因是民族环境的差异,而不是民族自身在生物学上的差异。” 在我完成了这本书之后,我认识到无论是史前时代还是现代,民族之间的接触产生了同样的问题。 然而,我希望我已经使读者相信,历史并不“就是一个又一个讨厌的事实”,就像一个愤世嫉俗者说的那样。的确存在着适用于历史的广泛模式,而寻找对这些模式的解释不但令人陶醉,也是大有裨益的。 第五章 历史上的穷与富 有些地区的粮食生产完全是独立出现的,在其他地区的任何作物或动物来到之前,许多本土作物(在有些情况下还有动物)就已驯化了。 原来有些文明是自然的馈赠 第六章 种田还是不种田 这就是说,采纳粮食生产为所谓的自身催化过程提供了例证——这是一个在正反馈循环中自身催化的过程,这个过程一旦开始,速度就越来越快。人口密度的逐步增加,迫使人们去奖励

[LeetCode] 179. Largest Number

题目 Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [3,30,34,5,9] Output: "9534330" Note: The result may be very large, so you need to return a string instead of an integer. 解题报告 首先,这是一个贪心问题,也就是说如果数字 a 和数字 b 比较 a 应该放在前面,那么整个字符串中 a 一定是会在 b 之前的;如果 a 比 b 前,b 比 c 前,a 一定会在 c 前面。这一点容易想到但是难以证明,因为这种比较相对于单

[LeetCode] 98. Validate Binary Search Tree

题目 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater than the node's key. Both the left and right subtrees must also be binary search trees. Example 1: Input: 2 / \ 1 3 Output: t

[LeetCode] 111. Minimum Depth of Binary Tree

题目 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a node with no children. Example: Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 return its minimum depth = 2. 解题报告 思路 反正就是,有叶子就往下找,没叶子就完事儿了嘛~ 方法一:递归 在处理一颗树的时候递归往往是很容易想到的方法,对于每个节点只要检查左

[LeetCode] 207. Course Schedule

题目 LeetCode 链接 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses? Example 1: Input: 2, [[1,0]] Output: true Explanation: There are