
Java
文章平均质量分 57
月牙儿June
业精于勤荒于嬉,Practice makes perfect!
展开
-
Mysql数据库查询符合where条件的某几条结果sql语句
select * from tbl_files where p_id = ? and file_type = ? order by time desc limit ?,? 其中,where、order by、limit 的顺序必须是where ... order by .... limit 3,9.3和9分别代表查询从第3条开始的 9条数据。原创 2016-07-04 17:12:01 · 5224 阅读 · 0 评论 -
贪心Greedy
先看一下这个问题:LeetCode 55. Jump GameQuestionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo原创 2017-03-15 10:54:42 · 360 阅读 · 0 评论 -
动态规划(DP)问题分析汇总
问题一:LeetCode 53. Maximum Subarray求最小和Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,原创 2017-03-14 11:07:53 · 506 阅读 · 0 评论 -
LeetCode 75 Sort Colors
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers原创 2017-04-09 21:55:43 · 543 阅读 · 2 评论 -
Leetcode56 归并重复区间
new Comparator() { @Override public int compare(Interval i1, Interval i2) { return Integer.compar一、java list得到数组长度的方法如下:1 java中的length属性是针对数组说的,比如说你声明了一个数组,想知道这个数组的原创 2017-03-05 17:04:58 · 443 阅读 · 0 评论 -
Java中static关键字用法
static 是静态、全局的意思。一般情况下,一个类的不同对象之间的成员都是相互独立的,但是,在想要该类的所有对象共享同一个成员时就要用到static。此时这个static的成员是被整个类共享的,而不是某个对象的。1.静态成员变量:可以理解为全局变量,但是java中没有全局变量的概念。2.静态方法使用静态方法时,直接用类名+“.”+方法名。不用再实例化,创建类的对象3.静态原创 2017-02-28 13:14:53 · 265 阅读 · 0 评论 -
LeetCode 27. Remove Element
分类: Array ; Two Points问题描述:Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this原创 2016-11-30 21:31:27 · 383 阅读 · 0 评论 -
LeetCode 100. Same Tree
分类:Tree ;DFS问题描述: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原创 2016-11-29 20:38:32 · 267 阅读 · 0 评论 -
关于sql语句查询--top关键字
Top关键字:1、首先引用一位网友出错的例子,sql="select top 30 * from data where title='"&title1&"' order by id desc"分析出错原因:sql语句里同时存在where和top语句的时候,并且where条件列不是合适的索引,程序执行的是全表扫描,首先是查找符合where条件的记录,而这里的top限制形同虚设。如果全表是百万原创 2016-07-04 16:00:21 · 8643 阅读 · 0 评论 -
LeetCode 101. Symmetric Tree
分类 :Tree; BFS; DFS 问题描述:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1原创 2016-11-29 19:55:57 · 271 阅读 · 0 评论 -
java spring mvc 文件上传教程
java spring mvc 文件上传教程原创 2016-07-04 17:48:01 · 1076 阅读 · 3 评论 -
Java常见内存溢出OOM
一、jvm内存区域1, 程序计数器一块很小的内存空间,作用是当前线程所执行的字节码的行号指示器。2, java栈与程序计数器一样,java栈(虚拟机栈)也是线程私有的,其生命周期与线程相同。通常存放基本数据类型,对象引用(一个指向对象起始地址的引用指针或一个代表对象的句柄),returnAddress类型(指向一条字节码指令的地址)栈区域原创 2017-04-25 10:24:50 · 357 阅读 · 0 评论