01 2013 档案

二叉树相关的数据结构和算法
摘要:1. 二叉树(binary tree):最基本树型结构,每个结点最多有两个子节点,分别成为左子节点(left child node)和右子节点(right child node)。相关题目:a. 给定根结点,计算二叉树的最大深度。View Code //递归解法class Solution {public:int maxDepth(TreeNode* root){ if (root == NULL) return 0; if (root->left == NULL && root->right == NULL) return 1; if (root->left 阅读全文

posted @ 2013-01-25 01:25 梁霄 阅读(303) 评论(0) 推荐(0)

读书笔记:Sed & Awk 之 Awk篇
摘要:1. Awk's programming model: The main loop in awk is a routine that reads one line of input from a file and makes it avaiblable for processing. You can use BEGIN/END to execute commands before/after the loop.2. Similar to sed, printing matched line content is the default behavior if no other acti 阅读全文

posted @ 2013-01-02 14:32 梁霄 阅读(246) 评论(0) 推荐(0)

导航