首页 > 其他
二叉数的非递归遍历
二叉树是一种非常重要的数据结构,很多其它数据结构都是基于二叉树的基础演变而来的。对于二叉树,有前序、中序以及后序三种遍历方法。因为树的定义本身就是递归定义,因此采用递归的方法去实现树的三种遍历不仅容易理解而且代码很简洁。而对于树的遍历若采用...
分类:其他   时间:2015-04-11 18:00:14    收藏:0  评论:0  赞:0  阅读:237
Palindrome Partitioning II--LeetCode
题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab"...
分类:其他   时间:2015-04-11 18:00:04    收藏:0  评论:0  赞:0  阅读:190
Canvas之太阳系
太阳系 您的浏览器不支持 var cxt = document.getElementById('canvas').getContext('2d');//设置2d环境 //轨道 function drawTrack() { for (var i = 0; i < 8; i++) { ...
分类:其他   时间:2015-04-11 17:59:54    收藏:0  评论:0  赞:0  阅读:227
资源加载卸载与内存的关系
22 关于Resources.load和实例化与内存的关系: 1.加载,单纯的Resources.load后消耗的内存很低,可能只是基础的引用预载、当对象被实例化后才会占用大量内存,当实例化多个对象后和实例化一个相差不大,可能后边实例的对象引用了第一个。 2.卸载,单纯的把所有实例的obj给destroy后,内存不会释放,但是再次实例也不会耗内存,若Object b = Resources.L...
分类:其他   时间:2015-04-11 17:59:44    收藏:0  评论:0  赞:0  阅读:425
Leetcode (5) Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.简而言之,判断两棵二叉树是否相等,这里...
分类:其他   时间:2015-04-11 17:59:34    收藏:0  评论:0  赞:0  阅读:221
[LeetCode]House Robber
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house...
分类:其他   时间:2015-04-11 17:59:24    收藏:0  评论:0  赞:0  阅读:187
Leetcode (6) Remove Duplicates from Sorted Array
题目描述Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with...
分类:其他   时间:2015-04-11 17:59:14    收藏:0  评论:0  赞:0  阅读:186
hdu 2120 Ice_cream's world I
就是问有多少个圈,简单的并查集,没啥好说的,心塞不开心 #include using namespace std; int mapp[1000+5]; void s() { for(int i=0;i<1000+5;i++) mapp[i]=i; } int bfs(int x) { if(x!=mapp[x]) { mapp[x]=bfs(mapp[x]); } return m...
分类:其他   时间:2015-04-11 17:58:44    收藏:0  评论:0  赞:0  阅读:225
hdu 4737 二分或暴力
http://acm.hdu.edu.cn/showproblem.php?pid=4737 Problem Description There are n numbers in a array, as a0, a1 ... , an-1, and another number m. We define a function f(i, j) = ai|ai+1|ai+2| ... ...
分类:其他   时间:2015-04-11 17:58:24    收藏:0  评论:0  赞:0  阅读:236
hihocoder#1049 : 后序遍历
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在参与过了美食节之后,小Hi和小Ho在别的地方又玩耍了一阵子,在这个过程中,小Ho得到了一个非常有意思的玩具——一棵由小球和木棍连接起来的二叉树! 小Ho对这棵二叉树爱不释手,于是给它的每一个节点都标记了一个标号——一个属于A..Z的大写字母,并且没有任意两个节点的标号是一样的。小Hi也...
分类:其他   时间:2015-04-11 17:58:04    收藏:0  评论:0  赞:0  阅读:155
执行setResult后的回调顺序
A ——> startActivityForResult ——> B ——>setResult 不执行finish 方法  A是在B执行了setResult方法还是B被finish后执行onActivityResult方法? A ——> startActivityForResult ——> B ——>setResult ——> finish 如果栈里面A和B中间还有activity  A将不会在...
分类:其他   时间:2015-04-11 17:57:54    收藏:0  评论:0  赞:0  阅读:419
Best Cow Line(POJ-3617)
经典的贪心算法。   贪心算法的特点是总是取最优解,最后得到的也是最优,这一点上与动归不同。动归和搜索都是多策略的,所以贪心的理解难度还是很小的。 #include #include #include #include #include #include #include using namespace std; int n,a; vector ans; int main() { sca...
分类:其他   时间:2015-04-11 17:57:04    收藏:0  评论:0  赞:0  阅读:135
RT-Thread 学习笔记(十二)--- 开启基于RTGUI的LCD显示功能(2)
软件环境:Win7,Keil MDK 4.72a, IAR EWARM 7.2, GCC 4.2,Python 2.7 ,SCons 2.3.2 硬件环境:Armfly STM32F103ZE-EK v3.0开发板 参考文章:RT-Thread编程指南 RT-Thread_1.2.0+lwip+rtgui0.8.0 移植心得 RT-Thread RTOS组件:RTGUI...
分类:其他   时间:2015-04-11 17:56:54    收藏:0  评论:0  赞:0  阅读:3160
@半条_虫 淘宝天猫自动批量打旗帜插件,精准打旗解放双手
/* * * 淘宝天猫批量打旗帜工具 Beta 1.0.0.0 * Release date:  * Author : 半条虫(466814195) * Keywords : Etsoftware 半条虫(466814195) rimke 39doo 39度 * Description : 本脚本功能由EtSoftWare团队研发,仅供学习不得用于商业用途。 * Blog...
分类:其他   时间:2015-04-11 17:56:34    收藏:0  评论:0  赞:0  阅读:591
hdu 2151 Worm
最简单的动归,当然,我也只会最简单的,不开心心塞中 #include #include using namespace std; int dp[100+5][100+5]; int main() { int n,p,m,t; while(cin>>n>>p>>m>>t) { memset(dp,0,sizeof(dp)); dp[0][p]=1; for(int i=1;i<=...
分类:其他   时间:2015-04-11 17:56:24    收藏:0  评论:0  赞:0  阅读:222
Red and Black.(POJ-1979)
DFS水题。 #include #include #include #include #include using namespace std; int dx[] = {0,1,0,-1} ; int dy[] = {1,0,-1,0} ; int n,m,maxn; int vis[25][25]; char s[25][25]; struct pa{ int r,c; }; voi...
分类:其他   时间:2015-04-11 17:56:14    收藏:0  评论:0  赞:0  阅读:243
Boost.deadline_timer实现定时器功能时需注意的时区问题
利用boost.deadline_timer() 可以很方便的实现定时器功能,详情参考:http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/reference/deadline_timer.html...
分类:其他   时间:2015-04-11 17:55:44    收藏:0  评论:0  赞:0  阅读:417
机器人视觉识别技术简介
基于颜色特征的物体识别系统对于不同颜色的分别提取和识别 (以上两幅图片由某大学机器人实验室负责人暨机器人天空主编Liu Weichao友情提供) 随着计算机科学和自动控制技术的发展,越来越多的不同种类的智能机器人出现在生产生活中,视觉系统作为智能机器人系统中一个重要的子系统,也越来越受到人们的重视。 视觉系统是一个非常复杂的系统,它既要做到图像的准确采集还要做到对外界变化反应的实...
分类:其他   时间:2015-04-11 17:55:34    收藏:0  评论:0  赞:0  阅读:169
drawImage()方法
drawImage(image, x, y) drawImage(image, x, y, width, height) drawImage(image, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight)drawImage() 方法有 3 个变形。第一个变形把整个图像...
分类:其他   时间:2015-04-11 17:55:24    收藏:0  评论:0  赞:0  阅读:254
JAX-RS开发(二):hello world
1.建立maven webapp工程aty-rest。 2. 在pom文件增加spring框架、jax-rs接口、CXF实现 javax.ws.rs javax.ws.rs-api 2.0 org.springframework spring-web 3.1.1.RELEASE org.apache.cxf cxf-rt-frontend-jaxrs 3.0...
分类:其他   时间:2015-04-11 17:55:14    收藏:0  评论:0  赞:0  阅读:180
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!