首页 > 2014年07月07日 > 全部分享
leecode 树的平衡判定 java
以前写过c++版本的,感觉java写的好舒心啊/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * Tree...
分类:编程语言   时间:2014-07-07 15:27:36    收藏:0  评论:0  赞:0  阅读:330
Problem Triangle
Problem Description:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For ex...
分类:其他   时间:2014-07-07 15:28:54    收藏:0  评论:0  赞:0  阅读:275
Android 遍历界面控件
//遍历界面上的控件 fubin.pan LinearLayout sLinerLayout = (LinearLayout)findViewById(R.id.layout_scr); for (int i = 0; i < sLinerLayout.getChildCount(); i++).....
分类:移动平台   时间:2014-07-07 15:28:17    收藏:0  评论:0  赞:0  阅读:498
android 点九工具介绍
1=============================9.png简介:“点九”是andriod平台的应用软件开发里的一种特殊的图片形式,文件扩展名为:.9.pngandroid平台有多种不同的分辨率,很多控件的切图文件在被放大拉伸后,边角会模糊失真。在android平台下使用点九PNG技术,可...
分类:移动平台   时间:2014-07-07 15:29:27    收藏:0  评论:0  赞:0  阅读:334
Leetcode Length of Last Word
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe...
分类:其他   时间:2014-07-07 15:30:05    收藏:0  评论:0  赞:0  阅读:266
八大排序算法总结
插入排序1.直接插入排序原理:将数组分为无序区和有序区两个区,然后不断将无序区的第一个元素按大小顺序插入到有序区中去,终于将全部无序区元素都移动到有序区完毕排序。要点:设立哨兵,作为暂时存储和推断数组边界之用。实现:VoidInsertSort(NodeL[],intlength){Inti,j;/...
分类:其他   时间:2014-07-07 15:30:43    收藏:0  评论:0  赞:0  阅读:288
[Leetcode][Tree][Depth of Binary Tree]
计算树的深度1、minimum depth of binary tree 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * ...
分类:其他   时间:2014-07-07 15:31:23    收藏:0  评论:0  赞:0  阅读:314
lru cache java
http://www.acmerblog.com/leetcode-lru-cache-lru-5745.htmlacm之家的讲解是在是好,丰富import java.util.LinkedHashMap;public class LRUCache { private int capacit...
分类:编程语言   时间:2014-07-07 15:32:05    收藏:0  评论:0  赞:0  阅读:604
kNN(K-Nearest Neighbor)最邻近规则分类
KNN最邻近规则,主要应用领域是对未知事物的识别,即推断未知事物属于哪一类,推断思想是,基于欧几里得定理,推断未知事物的特征和哪一类已知事物的的特征最接近;K近期邻(k-Nearest Neighbor,KNN)分类算法,是一个理论上比較成熟的方法,也是最简单的机器学习算法之中的一个。该方法的思路是...
分类:其他   时间:2014-07-07 15:32:46    收藏:0  评论:0  赞:0  阅读:466
Double 类型运算时的精度问题
double 类型运算时的 计算的精度不高,常常会出现0.999999999999999这种情况,那么就须要用BigDecimal 它是java提供的用来高精度计算的工具类 以下是对这个类的一个包装,方便使用:package cn.soft.util;import java.io.Serializa...
分类:其他   时间:2014-07-07 15:33:24    收藏:0  评论:0  赞:0  阅读:423
Longest Valid Parentheses
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:其他   时间:2014-07-07 15:33:56    收藏:0  评论:0  赞:0  阅读:304
android系统自带图标
android:src="@android:drawable/ic_media_rew"
分类:移动平台   时间:2014-07-07 15:34:36    收藏:0  评论:0  赞:0  阅读:354
二叉树重建
假如先序串:DBACEGF,先序的第一个节点一定是根节点,这样我们就知道了根节点是D.再看中序, 在中序串之中,根结点的前边的所有节点都是左子树中,ABCDEFG,所以D节点前面的ABC就是左子树的中序串。再看前续串 DBACEGF, 由于左子树的节点是ABC,我们可以得到左子树的前续周游的串为: ...
分类:其他   时间:2014-07-07 15:35:57    收藏:0  评论:0  赞:0  阅读:297
C#中字符串的字面值(转义序列)
在程序开发中,经常会碰到在字符串中字面值中使用转义序列,下面表格收集了下转义序列的完整列表,以便大家查看引用:转义序列列表转义序列产生的字符字符的Unicode值\'单引号0x0027\"双引号0x0022\\反斜杠0x005C\0空0x0000\a警告(产生蜂鸣)0x0007\b退格0x0008\...
分类:其他   时间:2014-07-07 15:36:38    收藏:0  评论:0  赞:0  阅读:593
Internet Explorer Developer Channel 自动化测试 IE 浏览器
IE 原生 Web Driver 调用,通过简单配置,即可自动化测试 IE 浏览器(目前仅限 Internet Explorer Developer Channel 版本)。做一些自动化的操作,都是很容易的。如快速登录、抢票等。开始-运行-cmd粘贴或输入 格式:LinrIEWebDriver.ex...
分类:Web开发   时间:2014-07-07 15:37:59    收藏:0  评论:0  赞:0  阅读:435
Gallery 里面怎么设置ImageView的OnClick事件
Gallery g=this.findViewById(R.id.gallery);g.setOnItemClickListener(new OnItemClickListener(){ @Override ...
分类:其他   时间:2014-07-07 15:37:23    收藏:0  评论:0  赞:0  阅读:413
The in operator
The operators we have seen so far are all special characters like + and *, but there are a few operators that are words. in is a boolean operator that...
分类:其他   时间:2014-07-07 15:38:35    收藏:0  评论:0  赞:0  阅读:366
leveldb源码分析--Comparator
既然leveldb是一个按Key序组织的LSM-Tree实现,那么对于Key的比较就是非常之重要了,这个Key的比较在leveldb中是Comparator的形式出现的。我们首先来看看Comparator的基本方法有哪些 // 实际的比较函数 virtual int Compare(const Sl...
分类:数据库技术   时间:2014-07-07 15:39:14    收藏:0  评论:0  赞:0  阅读:481
5.3.1 6174问题
假设你有一个各位数字互不相同的四位数,把所有数字从大到小排序后得到a,从小到大排序后得到b,然后用a-b替换原来这个数,并且继续操作。例如,从1234出发,依次可以得到4321-1234=3087、8730-378=8352、8532-2358=6174、7641-1467=6174。有趣的是,最后...
分类:其他   时间:2014-07-07 15:39:51    收藏:0  评论:0  赞:0  阅读:252
Problem Pascal's Triangle
Problem Description:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1...
分类:其他   时间:2014-07-07 15:40:31    收藏:0  评论:0  赞:0  阅读:182
1396条   上一页 1 ... 33 34 35 36 37 ... 70 下一页
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!