码迷,mamicode.com
首页 >  
搜索关键字:right    ( 9126个结果
Binary Tree Postorder Traversal && Binary Tree Preorder Traversal
注:后序遍历是较麻烦的一个,不可大意。关键两点: 1.要走到 p->left | p->right ==0, 2.每次出栈出两个结点。
分类:其他好文   时间:2014-08-10 01:45:39    阅读次数:286
leetcode 刷题之路 63 Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). zigzag层序遍历树 For example: Given binary...
分类:其他好文   时间:2014-08-09 23:19:59    阅读次数:363
B - I Hate It
1 #include 2 #include 3 using namespace std; 4 int ans; 5 int max1=0; 6 int a[200010]; 7 struct Node{ 8 int left; 9 int right;10 int max;...
分类:其他好文   时间:2014-08-09 22:55:19    阅读次数:283
二维线段树模式
1 #include 2 using namespace std; 3 const int N=3000; 4 struct SubNode 5 { 6 int left,right; 7 int value; 8 } 9 struct Node10 {11 int lef...
分类:其他好文   时间:2014-08-09 18:30:18    阅读次数:191
根据经纬度查询附近的点
大致思想:根据给定经纬度(lat,lng)求出其左上角(left_top),右上角(right_top),左下角(left_bottom),右下角(right_bottom)的四个位置。所有在这个区域的范围都在该点附近。参照:http://blog.charlee.li/location-searc...
分类:其他好文   时间:2014-08-09 18:08:48    阅读次数:252
HTML5 Canvas核心技术—图形、动画与游戏开发.pdf5
文本的定位水平与垂直定位:当使用strokeText()和fillText()绘制文本时,指定了所绘文本的X与Y坐标,还有textAlign与textBaseline两个属性textAlign:start(默认) center end left right,当canvas元素的dir属性是ltr时,...
分类:Web程序   时间:2014-08-09 02:30:36    阅读次数:240
[leetcode]Unique Paths
Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a...
分类:其他好文   时间:2014-08-09 00:02:06    阅读次数:201
[leetcode]Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level...
分类:其他好文   时间:2014-08-08 23:53:16    阅读次数:221
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!