5.实现文件复制 1 int CopyFile(char *SourceFile,char *NewFile) 2 { 3 ifstream in; 4 ofstream out; 5 in.open(SourceFile,ios::binary);//打开源文件 6 ...
分类:
数据库 时间:
2014-11-21 10:27:07
阅读次数:
293
一:起因
(1)STL中关于二分查找的函数有三个:lower_bound 、upper_bound 、binary_search —— 这三个函数都运用于有序区间(当然这也是运用二分查找
的前提),下面记录一下这两个函数;
(2)ForwardIter lower_bound(ForwardIter first, ForwardIter last,const _Tp& val)算法返回一个...
分类:
其他好文 时间:
2014-11-20 23:47:22
阅读次数:
152
本文将介绍linux挂载文件系统的过程,从系统调用mount()函数开始解析,主要分为三个阶段:
1、新建源文件系统;
2、查找目的文件系统的挂载目录;
3、将源文件系统挂载到目的文件系统的挂载目录;...
分类:
系统相关 时间:
2014-11-20 23:46:11
阅读次数:
263
Is It A Tree?
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 22631
Accepted: 7756
Description
A tree is a well-known data structure that is either empty (nu...
分类:
其他好文 时间:
2014-11-20 20:25:15
阅读次数:
210
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".Solution: 1 public class Solution { 2 publi...
分类:
其他好文 时间:
2014-11-20 18:18:52
阅读次数:
206
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solutio...
分类:
其他好文 时间:
2014-11-20 17:05:34
阅读次数:
205
叶子节点的SG值为0 非叶子节点的SG值为为它的所有子节点的SG值加1 后的异或和
#include
#include
#include
using namespace std;
vector G[100010];
int sg[100010];
int dfs(int x, int f)
{
if(sg[x] != -1)
return sg[x];
if(!G[x].size...
分类:
其他好文 时间:
2014-11-20 15:25:46
阅读次数:
200
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-11-20 15:06:39
阅读次数:
212
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-11-20 14:54:26
阅读次数:
230
0.准备工作0.1 git安装http://git-scm.com/download/图形客户端建议使用source tree,中文界面http://www.sourcetreeapp.com/0.3 git帮助信息git helpgit help 指令名称0.4 git配置显示配置信息git co...
分类:
其他好文 时间:
2014-11-20 14:53:51
阅读次数:
292