翻转一棵二叉树样例 1 1
/ \ / 2 3 => 3 2
/ 4 4
递归版本先翻转左子树,后翻转右子树,然后对整个树进行翻转void swapTree(TreeNode *&root){
TreeNode *tmp = root->left;
root->left = root->right...
分类:
其他好文 时间:
2015-07-31 16:14:59
阅读次数:
112
#include#include#includevoid swap(int *a, int i, int j){ int tmp = a[i]; a[i] = a[j]; a[j] = tmp;}void BubbleSort(int *a, int n){ for (int...
分类:
编程语言 时间:
2015-07-31 12:28:03
阅读次数:
132
#include#include#includeusing namespace std;void swap(int *a, int i, int j){ int tmp = a[i]; a[i] = a[j]; a[j] = tmp;}int partition(int *a, i...
分类:
编程语言 时间:
2015-07-31 11:59:47
阅读次数:
147
今天在笔记本上安装了KaliLinux。配置为4GB+320GB
分区如下:
挂载点
格式
大小
/boot
ext4
100MB
/
ext4
20GB
/home
ext4
余下最大空间
/tmp
ext4
4GB
交换分区
swap
6GB
装好之后发现居然没有sshd-generate,但是servicesshstart之后,secureCRT可..
分类:
系统相关 时间:
2015-07-30 23:43:39
阅读次数:
264
#include
#include
#include Kint tmp[1000], cnt, rec[1000];
int prime[30] = {0, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 39, 41, 43, 47};
double ans, LOG[30];void DFS(int...
分类:
其他好文 时间:
2015-07-30 23:17:25
阅读次数:
251
背景:openstackjuno版本,使用glance创建centos7镜像,然后生成虚拟机。操作步骤:首先获取镜像http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1503.qcow2wget -P /tmp/...
分类:
其他好文 时间:
2015-07-30 19:20:51
阅读次数:
339
遇到的坑:1、Hive的任务会从临时目录移动数据到数据仓库目录,默认hive使用/tmp作为临时目录,用户通常使用/user/hive/warehouse/作为数据仓库目录。在FederatedHDFS情况下,/tmp和/user视为两个不同的ViewFSmounttable,所以hive任务在这两个目录之间移动数据。FederatedHDFS..
分类:
其他好文 时间:
2015-07-30 15:11:51
阅读次数:
1079
[client]port = 3306socket = /home/mysql/mysql/tmp/mysql.sock[mysqld]!include /home/mysql/mysql/etc/mysqld.cnf ...
分类:
数据库 时间:
2015-07-30 13:10:56
阅读次数:
127
先贴上my.cnf[mysqld_multi]mysqld = /usr/bin/mysqld_safemysqladmin = /usr/bin/mysqladminuser =rootpassword =123456[mysqld2]socket = /tmp/mysql.sock2port =...
分类:
数据库 时间:
2015-07-30 12:57:49
阅读次数:
178
#include#include#include#define leftChild(i) (2*(i)+1)//交换void swap(int *a, int i, int j){ int tmp = a[i]; a[i] = a[j]; a[j] = tmp;}//堆下溯void...
分类:
编程语言 时间:
2015-07-30 11:11:08
阅读次数:
143