上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 119 下一页
摘要: 作用域规则告诉我们一个变量的有效范围,它在哪儿创建,在哪儿销毁(也就是说超出了作用域)。变量的有效作用域从它的定义点开始,到和定义变量之前最邻近的开括号配对的第一个闭括号。也就是说,作用域由变量所在的最近一对括号确定。 (1) 全局变量: 全局变量是在所有函数体的外部定义的,程序的所在部分(甚至其它 阅读全文
posted @ 2017-06-19 17:26 鸭子船长 阅读(233) 评论(0) 推荐(0)
摘要: rename命令用字符串替换的方式批量改变文件名。 语法 rename(参数) 参数 原字符串:将文件名需要替换的字符串; 目标字符串:将文件名中含有的原字符替换成目标字符串; 文件:指定要改变文件名的文件列表。 实例 将main1.c重命名为main.c rename main1.c main.c 阅读全文
posted @ 2017-06-19 17:23 鸭子船长 阅读(223) 评论(0) 推荐(0)
摘要: Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is 阅读全文
posted @ 2017-06-18 23:24 鸭子船长 阅读(226) 评论(0) 推荐(0)
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2017-06-18 22:52 鸭子船长 阅读(227) 评论(0) 推荐(0)
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: But the fol 阅读全文
posted @ 2017-06-18 22:47 鸭子船长 阅读(177) 评论(0) 推荐(0)
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2017-06-18 22:35 鸭子船长 阅读(448) 评论(0) 推荐(0)
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2017-06-18 22:21 鸭子船长 阅读(253) 评论(0) 推荐(0)
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 阅读全文
posted @ 2017-06-18 22:17 鸭子船长 阅读(183) 评论(0) 推荐(0)
摘要: 题意:根据二叉树的中序遍历和后序遍历恢复二叉树。 解题思路:看到树首先想到要用递归来解题。以这道题为例:如果一颗二叉树为{1,2,3,4,5,6,7},则中序遍历为{4,2,5,1,6,3,7},后序遍历为{4,5,2,6,7,3,1},我们可以反推回去。由于后序遍历的最后一个节点就是树的根。也就是 阅读全文
posted @ 2017-06-17 23:25 鸭子船长 阅读(213) 评论(0) 推荐(0)
摘要: 总结:1、按1继承顺序先排布基于每个父类结构。2、该结构包括:基于该父类的虚表、该父类的虚基类表、父类的父类的成员变量、父类的成员变量。3、多重继承且连续继承时,虚函数表按继承顺序排布函数与虚函数。4、而后排布子类的成员变量。5、排布虚基类的虚函数表。6、虚基类的成员变量 #类中的元素 0. 成员变 阅读全文
posted @ 2017-06-17 16:54 鸭子船长 阅读(248) 评论(0) 推荐(0)
上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 119 下一页