枚举支点之后数位DP,注意姿势#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace st...
                            
                            
                                分类:
其他好文   时间:
2014-08-02 18:11:43   
                                阅读次数:
301
                             
                    
                        
                            
                            
                                题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:之前做过一道是从sorted array转换到BinarySearc....
                            
                            
                                分类:
编程语言   时间:
2014-08-01 04:54:21   
                                阅读次数:
310
                             
                    
                        
                            
                            
                                Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tre...
                            
                            
                                分类:
其他好文   时间:
2014-07-31 23:20:20   
                                阅读次数:
267
                             
                    
                        
                            
                            
                                Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.算法:根据有序数组,生...
                            
                            
                                分类:
其他好文   时间:
2014-07-31 23:20:00   
                                阅读次数:
270
                             
                    
                        
                            
                            
                                Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
                            
                            
                                分类:
编程语言   时间:
2014-07-31 20:55:47   
                                阅读次数:
197
                             
                    
                        
                            
                            
                                题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ....
                            
                            
                                分类:
编程语言   时间:
2014-07-31 05:21:55   
                                阅读次数:
215
                             
                    
                        
                            
                            
                                题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the d....
                            
                            
                                分类:
编程语言   时间:
2014-07-31 05:21:35   
                                阅读次数:
221
                             
                    
                        
                            
                            
                                题目链接:http://poj.org/problem?id=3264
题目大意:就是给你一串数,问你最大数和最小数的差值。。。。。。。
思路:最基本的线段树,只需要建树和查询,修改都省啦,但是查询要写两个,一个查询最大值,一个查询最小值。。。。。。然后就能AC掉。。。。。但是话说poj把它分类到RMQ中。。。。
code:
#include
#include
#i...
                            
                            
                                分类:
其他好文   时间:
2014-07-29 22:03:22   
                                阅读次数:
404
                             
                    
                        
                            
                            
                                求区间内最大数和最小数的差,用两棵线段树,一个维护区间最大值,一个维护区间最小值。
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;
#define QUADMEM...
                            
                            
                                分类:
其他好文   时间:
2014-07-29 22:00:02   
                                阅读次数:
259
                             
                    
                        
                            
                            
                                Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个有序的链表,将其转换成平衡二叉搜索树思路: 二分法要构建一个平衡二叉...
                            
                            
                                分类:
其他好文   时间:
2014-07-29 13:40:48   
                                阅读次数:
601