摘要: 共同点:PreparedStatement和Statement都是用来执行SQL查询语句的API之一。不同点:在PreparedStatement中,当我们经常需要反复执行一条结构相似的sql语句,比如:insert into table values(0,'first',1);insert in... 阅读全文
posted @ 2015-01-06 16:12 Jarvis_Wu 阅读(3611) 评论(0) 推荐(0)
摘要: 1.环境变量的配置在配置tomcat的环境变量时始终配置不对,于是首先检查之前java的环境变量是否正确,发现java命令可以用但是javac却找不到,自己又瞎搞一通,终于javac可以用了,但java命令告诉我:Error:registry key 'software\Java Runtime E... 阅读全文
posted @ 2015-01-04 14:21 Jarvis_Wu 阅读(424) 评论(0) 推荐(0)
摘要: 题目:Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL... 阅读全文
posted @ 2014-12-28 15:50 Jarvis_Wu 阅读(231) 评论(1) 推荐(0)
摘要: 最近刚开始接触动态规划(Dynamic Programming)算法,之前略有耳闻,一直觉得DP非常之高大上,看了某些题的DP解法也是云里雾里,哇擦?!这么几行代码就解决了?怎么全是数组操作?时间复杂度也很低的样子。其实不然,当我真正开始学习动态规划的时候才发现这货没那么玄乎。把我对DP浅显的理解总... 阅读全文
posted @ 2014-12-24 17:06 Jarvis_Wu 阅读(458) 评论(0) 推荐(0)
摘要: 题目:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which ... 阅读全文
posted @ 2014-12-24 16:35 Jarvis_Wu 阅读(447) 评论(0) 推荐(1)
摘要: 题目:Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. ... 阅读全文
posted @ 2014-12-14 17:29 Jarvis_Wu 阅读(276) 评论(0) 推荐(0)
摘要: 题目:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains onl... 阅读全文
posted @ 2014-12-05 15:02 Jarvis_Wu 阅读(157) 评论(0) 推荐(0)
摘要: 题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in... 阅读全文
posted @ 2014-12-03 21:21 Jarvis_Wu 阅读(173) 评论(0) 推荐(0)
摘要: 题目:Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:我的第一个想法是将lists中的链表两两合并排序,这样时间复杂度是o(n),n为所有链表中的数据... 阅读全文
posted @ 2014-11-16 17:45 Jarvis_Wu 阅读(249) 评论(0) 推荐(0)