自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 103 Binary Tree Zigzag Level Order Traversal

题目链接:https://leetcode.com/problems/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

2015-07-29 18:30:34 325

原创 71 Simplify Path

题目链接:https://leetcode.com/problems/simplify-path/题目: Given an absolute path for a file (Unix-style), simplify it. For example, path = “/home/”, => “/home” path = “/a/./b/../../c/”, => “/c”

2015-07-28 20:54:49 324

原创 232 Implement Queue using Stacks

题目链接:https://leetcode.com/problems/implement-queue-using-stacks/题目: Implement the following operations of a queue using stacks. push(x) – Push element x to the back of queue. pop() – Removes

2015-07-28 17:59:08 288

原创 234 Palindrome Linked List

题目链接:https://leetcode.com/problems/palindrome-linked-list/题目: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?解题思路: 1、遍历第

2015-07-28 17:30:52 289

原创 7 Reverse Integer

题目链接:https://leetcode.com/problems/reverse-integer/题目:Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321注意: 判断输入数据是否在整数范围内。(Integer.MIN_VALUE,Integer.MAX_VALUE)

2015-07-27 23:22:27 298

原创 78 Subsets

题目链接:https://leetcode.com/problems/subsets/题目:Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not c

2015-07-27 23:11:39 333

原创 169 Majority Element

题目链接:https://leetcode.com/problems/majority-element/题目:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that

2015-07-27 23:07:32 279

原创 86 Partition List

题目链接:https://leetcode.com/problems/partition-list/题目:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the

2015-07-26 15:35:45 298

原创 147 Insertion Sort List

题目链接:https://leetcode.com/problems/insertion-sort-list/题目:Sort a linked list using insertion sort.解题思路: 1、插入排序的通用算法 2、链表的插入排序和数组的插入排序存在差异:链表:当前要插入的元素,对已排好序的链表从前往后比较数组:当前要插入的元素,对已排好序的数组从后往前比较(需要往后挪元

2015-07-25 15:32:04 489

原创 236 Lowest Common Ancestor of a Binary Tree

题目链接:https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/题目:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LC

2015-07-24 22:01:54 307

原创 160 Intersection of Two Linked Lists

题目链接:https://leetcode.com/problems/intersection-of-two-linked-lists/题目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linke

2015-07-24 17:02:55 325

原创 Json格式对象转换为XML

处理Json的包:javax.json 编制XML的包:org.jdom使用rest接口从前端获取Json格式的对象@Path("Testrest")public class TestRest extends ApiBase { @POST @Path("rest") @Consumes(MediaType.APPLICATION_JSON) public Do

2015-07-24 15:24:10 2094

原创 146 LRU Cache

题目链接:https://leetcode.com/problems/lru-cache/题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the val

2015-07-24 00:15:13 1141

原创 226 Invert Binary Tree

题目链接:https://leetcode.com/problems/invert-binary-tree/ 题目Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1解题思路: 1、先序遍历二叉树 2、若当前

2015-07-23 19:11:41 382

原创 104 Maximum Depth of Binary Tree

题目链接:https://leetcode.com/problems/maximum-depth-of-binary-tree/题目Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to

2015-07-22 12:02:38 446

原创 Sqoop对Mysql数据库导入导出到hdfs(基于Hadoop 2.6.0 )

Sqoop版本为1.4.5      Hadoop环境为2.6.0     数据库类型为Mysql使用Maven构建项目,将项目连同依赖包打包后上传到集群,使用hadoop命令行执行。Sqoop导入package sqoop;import java.io.IOException;import org.apache.hadoop.conf.Configuration;

2015-07-17 16:15:49 869

原创 替换class文件时,连同其内部类class文件一同替换

在修改以前别人的代码时,需要替换改过的.class文件。替换后重启Tomcat,发现运行结果没有变化,并且为调试而输出的内容也没有任何显示。后发现,修改的java类中包含了三个内部类,三个内部类分别形成了三个.class文件。系统四个.class文件(一个主类,三个内部类)显示修改时间相同。经过再次替换,日志终于显示了System.out输出的内容。结论: 往Tomcat里的jar包或者war包中

2015-07-17 15:49:56 2363

转载 ORACLE 中SCHEMA的概念以及数据库,表空间,数据文件等的区别

转载地址:http://langgufu.iteye.com/blog/1469055有的人还是对schema的真正含义不太理解,现在我再次整理了一下,希望对大家有所帮助。 我们先来看一下他们的定义: A schema is a collection of database objects (used by a user.). Schema objects are the logical

2015-07-14 15:04:21 1704

原创 面试题26 复杂链表的复制

题目地址:http://ac.jobdu.com/problem.php?pid=1524题目1524:复杂链表的复制题目描述: 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点)。 输入: 输入可能包含多个测试样例,输入以EOF结束。 对于每个测试案例,输入的第一行为一个整数n (1<=n<=1000):n代表将要输入的链表元素的个数。

2015-07-09 21:13:17 484

空空如也

空空如也

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

TA关注的人

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