题目大意:
修改树上的节点,然后求子树的和。
思路分析:
dfs 重新编号,烂大街了。。。
#include
#include
#include
#include
#define maxn 100005
#define lson num<<1,s,mid
#define rson num<<1|1,mid+1,e
using namespace std;
int num[...
分类:
移动开发 时间:
2014-07-31 20:46:27
阅读次数:
251
Binary Tree Traversals Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescript...
分类:
其他好文 时间:
2014-07-31 20:43:07
阅读次数:
218
转自:http://blog.chinaunix.net/uid-446337-id-94440.html分类:机器学习的有概率分类器(probabilistic) ,贝叶斯推理网络(bayesian inference networks) , 决策树分类器(decision tree) ,决策规则...
分类:
其他好文 时间:
2014-07-31 19:33:17
阅读次数:
411
Getting StartedThe above code inserts a default button with a android icon to the right. The following attributes can be added to any BootstrapButtonb...
分类:
其他好文 时间:
2014-07-31 16:34:56
阅读次数:
303
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:
其他好文 时间:
2014-07-31 16:08:26
阅读次数:
283
主要通过递归完成:
1 根节点是否相同,不相同,进行第一次递归
2 根节点相同,在另外一个函数进行递归,判断子节点是否相同
#include
#include
using namespace std;
typedef struct tree{
int key;
struct tree *left;
struct tree *right;
} * pTree,Tree;
...
分类:
其他好文 时间:
2014-07-31 13:35:56
阅读次数:
201
题目地址:HDU 1710
已知二叉树先序和中序求后序。
#include
#include
int a[1001], cnt;
typedef struct node
{
int date ;
node *lchild , *rchild ;
}*tree;
int getk(int ch,int ino[],int is,int n)
{
for(int i =...
分类:
其他好文 时间:
2014-07-31 13:25:46
阅读次数:
225
最近的项目,有个需求需要使用条状图显示比例,并且右对齐,这里对比了三种实现方案。
最终方案:利用Drawable本身的属性,反向绘制进度条。这里将backgroud注释掉,不现实backgroud,然后对前景色,加上两个关键属性:android:clipOrientation="horizontal",android:gravity="right",这样就做到从右到左画进度条。...
分类:
移动开发 时间:
2014-07-31 13:25:36
阅读次数:
202
红黑树数据结构#ifndef __RED_BLACK_TREE_H#define __RED_BLACK_TREE_H#define RED 1#define BLACK 0typedef struct Red_Black_Node{ int id; int color; int ...
分类:
其他好文 时间:
2014-07-31 12:49:56
阅读次数:
165
二叉树的前序遍历递归实现/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : v...
分类:
其他好文 时间:
2014-07-31 12:44:46
阅读次数:
188