题目:Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution s...
分类:
其他好文 时间:
2015-05-15 13:21:07
阅读次数:
113
题目:Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattene...
分类:
其他好文 时间:
2015-05-15 10:23:04
阅读次数:
119
题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / ...
分类:
其他好文 时间:
2015-05-15 10:22:50
阅读次数:
125
题目: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...
分类:
其他好文 时间:
2015-05-15 09:01:13
阅读次数:
145
题目: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 ...
分类:
其他好文 时间:
2015-05-14 23:37:22
阅读次数:
159
Visual Booster是Visual C++ 6.0开发环境的辅助工具,使用该工具打开.cpp、.h或者其他资源文件时会在左边及下边显示打开的窗口(并以后缀归类),查看源码的时候相当有用。1.下载Visual BoosterVisual Booster 下载地址:http://pan.baid...
分类:
编程语言 时间:
2015-05-14 23:34:29
阅读次数:
277
在复数类中的运算符重载基础上
(1)再定义一目运算符 -,-c相当于0-c。
(2)定义Complex类中的>运算符的重载,实现输入和输出,改造原程序中对运算结果显示方式,使程序读起来更自然。
/*
* Copyright (c) 2015,烟台大学计算机学院
* All right reserved.
* 作者:邵帅
* 文件:Demo.cpp
* 完成时间:2015年05月14日
* 版...
分类:
其他好文 时间:
2015-05-14 22:07:36
阅读次数:
98
在分数类中的运算符重载基础上
(1)定义分数的一目运算+和-,分别代表分数取正和求反,将“按位取反运算符”~重载为分数的求倒数运算。
(2)定义分数类中>运算符重载,实现分数的输入输出,改造原程序中对运算结果显示方式,使程序读起来更自然。
/*
* Copyright (c) 2015,烟台大学计算机学院
* All right reserved.
* 作者:邵帅
* 文件:Demo.cpp...
分类:
其他好文 时间:
2015-05-14 22:05:03
阅读次数:
128
在Time类中的运算符重载基础上
(1)定义对时间对象的自增和自减一目运算符
(2)定义Time类中的>运算符重载,实现时间的输入输出,改造原程序中对运算结果显示方式,使程序读起来更自然。
/*
* Copyright (c) 2015,烟台大学计算机学院
* All right reserved.
* 作者:邵帅
* 文件:Demo.cpp
* 完成时间:2015年05月14日
* 版本号...
分类:
其他好文 时间:
2015-05-14 22:05:00
阅读次数:
95
通讯基本流程图如下所示:Server端代码(ServerDemo.cpp): 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 #pragma comment(lib,...
分类:
其他好文 时间:
2015-05-14 18:13:52
阅读次数:
137