自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(137)
  • 资源 (3)
  • 收藏
  • 关注

原创 Spring 学习笔记-- Spring ContextLoaderListener 解析

Web容器在加载项目时,如Tomcat首先会加载项目的web.xml文件。容器对于web.xml的加载过程主要流程分为:context-param >> listener  >> fileter  >> servlet。Tomcat容器加载web项目的大致流程如下:在启动Web项目时,容器(比如Tomcat)会读web.xml配置文件中的两个节点和。接着容器会创建一个Servl

2015-07-25 17:39:05 1037

原创 Spring 学习笔记-- <mvc:default-servlet-handler />默认加载simpleurlhandlermapping

本博客只作为自己学习记录使用,如有错误,希望多指点指点Spring使用版本3.2,在项目配置Spring-mvc.xml中使用RequestMappingHandlerMapping时候(Spring3.1之前使用DefaultAnnotationHandlerMapping),但是没有配置order属性,同时项目配置<mvc:default-servlet-handler />

2015-07-24 12:29:15 5024

原创 【剑指offer】 面试题50: 树中两个结点的最低公共祖先(二叉排序数)

题目描述:给定一棵树,同时给出树中的两个结点,求它们的最低公共祖先。10 8 6 0 0 9 0 0 20 15 0 0 06 15存在, 10基本思想为:从树根开始1、该节点的值为t,如果t大于t1和t2,说明t1和t2都位于t的左侧,所以它们的共同祖先必定在t的左子树中,从t.lef

2015-06-09 21:14:40 640

原创 【剑指offer】 面试题50: 树中两个结点的最低公共祖先

题目描述:给定一棵树,同时给出树中的两个结点,求它们的最低公共祖先。方法一:后序遍历 基本思想:1、两个节点不在一条线上(即两个节点不存在一个节点是另一个节点的祖先的情况),则它们必定分别在所求节点A的左子树和右子树上,后序遍历到第一个满足这个条件的节点就是所要求的节点A。2、当

2015-06-09 20:34:55 847

原创 【剑指offer】 面试题10: 二进制中1的个数

题目描述:输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。九度 : http://ac.jobdu.com/problem.php?pid=1513package com.offer.chapter_2;import java.util.Scanner;public class Interviews_10 { publi

2015-06-09 16:27:25 459

原创 【剑指offer】 面试题8: 旋转数组的最小数字

题目描述:把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。九度 : http://ac.jobdu.com/problem.php?pid=1386不知道为什么一直超时。package com.

2015-06-09 16:00:21 456

原创 【剑指offer】 面试题7: 用两个栈实现队列

题目描述:用两个栈来实现一个队列,完成队列的Push和Pop操作。队列中的元素为int类型package com.offer.chapter_2;import java.util.Scanner;class Stack { private Object[] elem = new Object[100001]; private int top

2015-06-09 11:12:37 437

原创 【剑指offer】 面试题6: 重建二叉树

题目描述:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并输出它的后序遍历序列。九度:http://ac.jobdu.com/problem.php?pid=13

2015-06-09 10:31:57 414

原创 【剑指offer】 面试题5: 从尾到头打印链表

题目描述:输入一个链表,从尾到头打印链表每个节点的值。package com.offer.chapter_2;import java.util.Scanner;class Node { public int elem; public Node next;}/** * @author hadoop * * 输入一个链表,从尾到头打印链表每个节点的

2015-06-08 16:00:26 535

原创 【剑指offer】 面试题4: 替换空格

题目描述:请实现一个函数,将一个字符串中的空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。九度:http://ac.jobdu.com/problem.php?pid=1510package com.offer.chapter_2;import java.uti

2015-06-08 13:12:01 477

原创 【剑指offer】 面试题3: 二维数组中的查找

题目描述:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。package com.offer.chapter_2;import java.util.Scanner;public class Interviews_3 { public static bo

2015-06-08 11:09:31 705

原创 LeetCode 学习笔记:Question 1、Two Sum

Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to th

2015-04-27 14:51:16 454

转载 mysql 基本使用 : 中文乱码问题

1.列出MYSQL支持的所有字符集:SHOW CHARACTER SET;2.当前MYSQL服务器字符集设置SHOW VARIABLES LIKE 'character_set_%';3.当前MYSQL服务器字符集校验设置SHOW VARIABLES LIKE 'collation_%';4.显示某数据库字符集设置show create da

2015-04-25 09:16:58 674

原创 编程之美 -- 2.7 最大公约数问题

题目描述求解X 和 Y 的最大公约数f(x, y)解法一:使用辗转相除法,f(x, y) = f(y, x % y), x 和 y 数字偏大则取模运算偏多而开销大解法二:相减法,f(x,y) = f(x-y,y) , (x > y)。 可以解决取模开销问题,但是相对减法则迭代次数偏多解法三:结合以上两种优势,如果每次递归求

2015-04-10 09:32:40 515

原创 编程之美 -- 2.5 寻找最大的K个数(堆排序方法)

题目描述寻找N个数字中最大的K个数字package chapter_2_binary;import java.util.Scanner;/** * @author LiangGe * * 寻找一批数字中最K大数 * * 前K个元素,建立小顶堆,之后每个元素和堆顶元素比较 * */public class question_2_5_3 {

2015-04-07 20:36:36 614

原创 编程之美 -- 2.5 寻找最大的K个数(快排方法)

题目描述寻找N个数字中最大的K个数字package chapter_2_binary;import java.util.Random;import java.util.Scanner;/** * @author LiangGe * * 寻找一批数字中最K大数 * * 使用方法类似快速排序查找 * */public class question_2_

2015-04-07 20:34:59 703

原创 Cracking the coding interview--Q8.8

原文:Write an algorithm to print all ways of arranging eight queens on a chess board so that none of them share the same row, column or diagonal.译文:经典的八皇后问题,即在一个8*8的棋盘上放8个皇后,使得这8个皇后无法互相攻击( 任

2014-12-15 21:08:01 462

原创 Cracking the coding interview--Q8.7

原文:Given an infinite number of quarters (25 cents), dimes (10 cents), nickels (5 cents) and pennies (1 cent), write code to calculate the number of ways of representing n cents.译文:我们有25分,1

2014-12-15 20:45:32 515

原创 Cracking the coding interview--Q9.7

原文:A circus is designing a tower routine consisting of people standing atop one another’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the pers

2014-12-15 20:19:07 484

原创 Cracking the coding interview--Q9.6

原文:Given a matrix in which each row and each column is sorted, write a method to find an element in it.译文:给出一个矩阵,其中每一行和每一列都是有序的,写一个函数在矩阵中找出指定的数。矩阵是有序的,因此要利用这一点,当矩阵中元素和要查找的元素对比后,

2014-12-15 12:50:12 502

原创 Cracking the coding interview--Q9.5

原文:Given a sorted array of strings which is interspersed with empty strings, write a method to find the location of a given string.Example: find “ball” in [“at”, “”, “”, “”, “ball”, “”, “”, “c

2014-12-15 12:29:56 435

转载 Cracking the coding interview--Q9.4

原文:If you have a 2 GB file with one string per line, which sorting algorithm would you use to sort the file and why?译文:如果你有个2GB的文件,其中每一行是一个字符串,你会使用哪种算法来排序,为什么?当面试官说到2GB文件的时候,

2014-12-15 11:20:07 396

原创 Cracking the coding interview--Q9.3

原文:Given a sorted array of n integers that has been rotated an unknown number of times, give an O(log n) algorithm that finds an element in the array. You may assume that the array was originally

2014-12-15 11:07:55 481

原创 Cracking the coding interview--Q9.2

原文:Write a method to sort an array of strings so that all the anagrams are next to each other.译文:写一个函数对字符串数组排序,使得所有的变位词都相邻。解答首先需要理解什么是变位词?变位词就是字符组成的元素相同,只不过位置不同而已,例如:abc与

2014-12-15 09:55:40 438

原创 Cracking the coding interview--Q9.1

原文:You are given two sorted arrays, A and B, and A has a large enough buffer at the end to hold B. Write a method to merge B into A in sorted order.译文:A和B是两个有序数组(假设为递增序列),而且A的长度足以放下A和B中所有的

2014-12-14 21:35:37 330

原创 Cracking the coding interview--Q8.5

原文:Implement an algorithm to print all valid (e.g., properly opened and closed) combinations of n-pairs of parentheses.EXAMPLE:input: 3 (e.g., 3 pairs of parentheses)output: ((())), ((

2014-12-10 19:28:43 443

原创 Cracking the coding interview--Q8.4

原文:Write a method to compute all permutations of a string译文:写一个函数返回一个串的所有排列比如,计算 “abc”的全排列abc acb bac bca cab cba对于一个长度为n的串,它的全排列共有A(n, n)=n!种。这个问题也是一个递归的问题, 不过可以用不

2014-12-10 18:49:19 489

原创 Cracking the coding interview--Q8.3

原文:Write a method that returns all subsets of a set.译文:写一个函数返回一个集合中的所有子集。对于一个集合,它的子集一共有2n 个(包括空集和它本身)。它的任何一个子集, 我们都可以理解为这个集合本身的每个元素是否出现而形成的一个序列。比如说, 对于集合{1, 2, 3},空集表示一个元素都没出现,

2014-12-10 17:37:23 443

原创 Cracking the coding interview--Q8.2

原文:Imagine a robot sitting on the upper left hand corner of an NxN grid. The robot can only move in two directions: right and down. How many possible paths are there for the robot?FOLLOW UP

2014-11-26 14:23:31 480

原创 Cracking the coding interview--Q8.1

原文:Write a method to generate the nth Fibonacci number.译文:写一个函数来产生第n个斐波那契数。斐波那契数列的定义如下:f(1) = f(2) = 1;f(n) = f(n-1) + f(n-2);package chapter_8_Recursion;import ja

2014-11-26 10:57:58 387

原创 Cracking the coding interview--Q5.7

原文:An array A[1…n] contains all the integers from 0 to n except for one number which is missing. In this problem, we cannot access an entire integer in A with a single operation. The elements of A

2014-11-26 10:18:51 425

原创 Cracking the coding interview--Q5.6

原文:Write a program to swap odd and even bits in an integer with as few instructions as possible (e.g., bit 0 and bit 1 are swapped, bit 2 and bit 3 are swapped, etc).译文:写程序交换一个整数二进制表示中的奇数位

2014-11-24 20:12:33 319

原创 Cracking the coding interview--Q5.5

原文:Write a function to determine the number of bits required to convert integer A to integer B.Input: 31, 14Output: 2译文:写程序计算从整数A变为整数B需要修改的二进制位数。输入:31,14输出:2

2014-11-24 19:20:06 399

原创 Cracking the coding interview--Q5.3

原文:Given an integer, print the next smallest and next largest number that have the same number of 1 bits in their binary representation.译文:给定一个整数x,找出另外两个整数,这两个整数的二进制表示中1的个数和x相同, 其中一个是比x大的数

2014-11-24 15:59:19 517

原创 Cracking the coding interview--Q4.8

原文:You are given a binary tree in which each node contains a value. Design an algorithm to print all paths which sum up to that value. Note that it can be any path in the tree - it does not have t

2014-11-18 14:35:17 479

原创 Cracking the coding interview--Q4.7

原文:You have two very large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of T1译文:有两棵很大的二叉树:T1有上百万个结点,T2有上百个结点。写

2014-11-17 21:16:34 398

原创 Cracking the coding interview--Q4.6

原文:Design an algorithm and write code to find the first common ancestor of two nodes in a binary tree. Avoid storing additional nodes in a data structure. NOTE: This is not necessarily a binary se

2014-11-17 20:26:00 377

原创 Cracking the coding interview--Q4.5

原文:Write an algorithm to find the ‘next’ node (i.e., in-order successor) of a given node in a binary search tree where each node has a link to its parent.译文:给定二叉查找树的一个结点, 写一个算法查找它的“下一个”结点(

2014-11-17 16:06:21 365

原创 数据结构:二叉树的非递归遍历

package chapter_4_TreesandGraphs;import java.util.Scanner;import java.util.Stack;class TreeNode { public int data; public TreeNode lchild; public TreeNode rchild; public boolean isFirst;}

2014-11-16 11:31:00 601

原创 Cracking the coding interview--Q4.4

原文:Given a binary search tree, design an algorithm which creates a linked list of all the nodes at each depth (i.e., if you have a tree with depth D, you’ll have D linked lists).译文:给定一棵二叉查

2014-11-15 21:43:35 468

Spring MVC 集成 MyBatis demo

1、使用maven 构建项目,pom下载jar包 2、主要三个表 sm_user用户表 sm_authority用户权限表 sm_menu菜单表 3、主要实现用户登陆、以及不同用户登陆后通过权限判断返回相对的菜单目录,返回信息只有json数据,页面只显示json数据(注意) 4、mybatis接口编程实现三个表的基本查询、更新操作,并且实现一对多、多对一查询机制 5、并配有测试用例,分别测试三个表格的基本查询以及更新操作。 6、配有数据库sql文件

2015-06-26

android supportv4最新版本19.1

android support v4 最新版本 ,兼容低版本的开发jar包 包含最近比较有名的 下拉刷新组件 SwipeRefreshLayout 由于最近google 以及访问外网不是很好 而且 很多地方下载需要积分!

2014-08-10

mysqlJDBC的连接jar包

mysql-connector-java-5.1.25

2013-11-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除