上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页
摘要: Description:Given an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennums[i]andnum... 阅读全文
posted @ 2015-11-03 21:04 Pickle 阅读(298) 评论(0) 推荐(0) 编辑
摘要: Description:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory... 阅读全文
posted @ 2015-11-03 19:50 Pickle 阅读(806) 评论(0) 推荐(0) 编辑
摘要: SpringMVC概述 Spring的web框架围绕DispatcherServlet设计。 DispatcherServlet的作用是将请求分发到不同的处理器。 Spring的web框架包括可配置的处理器(handler)映射、视图(view)解析、本地化(local)解析、 主题(theme)解 阅读全文
posted @ 2015-10-31 22:20 Pickle 阅读(12702) 评论(2) 推荐(9) 编辑
摘要: 在知乎上看到了一个不错的回答,mark一下。 http://www.zhihu.com/question/20361462 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。作者:温悦链接:http://www.zhihu.com/question/20361462/answer/ 阅读全文
posted @ 2015-10-31 19:05 Pickle 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 在使用Spring MVC进行开发时,总是要对系统异常和用户的异常行为进行处理,以提供给用户友好的提示,也可以提高系统的安全性。 拦截系统响应错误 首先是拦截系统响应错误,这个可以在web.xml中配置,根据错误代码跳转到相应的提示页面。这里要注意一个问题,错误处理页面所用到的静态资源最好是直接写在 阅读全文
posted @ 2015-10-31 13:28 Pickle 阅读(15242) 评论(0) 推荐(2) 编辑
摘要: 使用SSM框架做了几个小项目了,感觉还不错是时候总结一下了。先总结一下SSM整合的文件配置。其实具体的用法最好还是看官方文档。 Spring:http://spring.io/docs MyBatis:http://mybatis.github.io/mybatis-3/ 基本的组织结构和用法就不说 阅读全文
posted @ 2015-10-30 23:53 Pickle 阅读(82733) 评论(17) 推荐(84) 编辑
摘要: 上次解0-1背包问题用的是动态规划法:http://www.cnblogs.com/wxisme/p/4898057.html这次用回溯法来解。01背包问题:给定n种物品和一背包。物品i的重量是wi其价值为vi,背包的容量为c。问如何选择装入背包的物品,使得装入背包中物品的总价值最大?在选择装入背包... 阅读全文
posted @ 2015-10-30 20:23 Pickle 阅读(681) 评论(0) 推荐(0) 编辑
摘要: 问题描述:有一个容量为c的背包,有n种物品,第i种物品的重量是wi,价值是vi;可以拿走一种物品的全部或者部分。怎样才能使背包装入的物品价值最大?分析:与0-1背包不同的是可以装入一种物品的一部分,在0-1背包只能用动态规划的方法来解,具体证明见《算法导论》,完全背包问题可以用动态规划来解也可以用贪... 阅读全文
posted @ 2015-10-28 23:36 Pickle 阅读(901) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://blog.csdn.net/jason314/article/details/5640969一、fork入门知识一个进程,包括代码、数据和分配给进程的资源。fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,也就是两个进程可以做完全相同的事,但如果初始参数或者传... 阅读全文
posted @ 2015-10-28 15:43 Pickle 阅读(603) 评论(0) 推荐(1) 编辑
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two... 阅读全文
posted @ 2015-10-28 11:32 Pickle 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 3.1需求工程的重要性是什么?举出身边由于需求分析失败而造成整个项目失败的例子。答:需求工程的重要性就是需求工程需要解决的问题,即需求工程是应用已证实的有效的技术、方法进行需求分析,确定客户需求,帮助分析人员理解问题,评估可行性,协商合理的解决方案、无歧义的规约方案、确认规约以及将规约转换到可运行的... 阅读全文
posted @ 2015-10-26 18:32 Pickle 阅读(1592) 评论(0) 推荐(1) 编辑
摘要: 最优二叉查找树:给定n个互异的关键字组成的序列K=,且关键字有序(k1= i时,需要从ki,...,kj中选择一个根kr,然后分别构造其左子树和右子树。下面需要计算以kr为根的树的期望搜索代价。然后选择导致最小期望搜索代价的kr做根。子树中每个节点深度都增加1.期望搜索代价增加量为子树中所有概率的总... 阅读全文
posted @ 2015-10-22 20:46 Pickle 阅读(780) 评论(0) 推荐(0) 编辑
摘要: 最长公共子序列:给定一个序列X={x1,x2,x3...xm},另一个序列Z={z1,z2,z3...zk}满足如下条件时称为X的子序列,即存在一个严格递增的X的下标序列对所有j=1,2...k满足xi=zj。给定两个序列X,Y,如果既是X的子序列又是Y的子序列,那就称为X,Y的公共子序列。最长公共... 阅读全文
posted @ 2015-10-22 20:04 Pickle 阅读(671) 评论(0) 推荐(0) 编辑
摘要: 最大子段和问题:给定n个整数(可能为负数)组成的序列a[1],a[2],a[3],…,a[n],求该序列如a[i]+a[i+1]+…+a[j]的子段和的最大值。当所给的整均为负数时定义子段和为0,依此定义,所求的最优值为: Max{0,a[i]+a[i+1]+…+a[j]},10时b[j]=b[j-... 阅读全文
posted @ 2015-10-22 16:46 Pickle 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 01背包问题:给定n种物品和一背包。物品i的重量是wi其价值为vi,背包的容量为c。问如何选择装入背包的物品,使得装入背包中物品的总价值最大?在选择装入背包的物品时,对每种物品i只有两种选择,即装入或者不装入。不能将物品i装入背包多次也不能只装部分的物品i。因此成为01背包问题。01背包问题的经典解... 阅读全文
posted @ 2015-10-21 15:55 Pickle 阅读(1147) 评论(0) 推荐(0) 编辑
摘要: LRU(Least Recently Used)算法是缓存技术中的一种常见思想,顾名思义,最近最少使用,也就是说有两个维度来衡量,一个是时间(最近),一个频率(最少)。如果需要按优先级来对缓存中的K-V实体进行排序的话,需要考虑这两个维度,在LRU中,最近使用频率最高的排在前面,也可以简单的说最近访 阅读全文
posted @ 2015-10-18 17:32 Pickle 阅读(2694) 评论(0) 推荐(1) 编辑
摘要: Description:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- ... 阅读全文
posted @ 2015-10-17 23:52 Pickle 阅读(448) 评论(0) 推荐(0) 编辑
摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2015-10-15 10:33 Pickle 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Description:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文
posted @ 2015-10-14 22:19 Pickle 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Description:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文
posted @ 2015-10-14 21:59 Pickle 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Description:Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.实现一个简单的Tr... 阅读全文
posted @ 2015-10-14 11:29 Pickle 阅读(243) 评论(0) 推荐(0) 编辑
摘要: Description:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove... 阅读全文
posted @ 2015-10-14 10:58 Pickle 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 字典树 又称单词查找树,Trie树,是一种树形结构,是一种哈希树的变种。典型应用是用于统计,排序和保存大量的字符串(但不仅限于字符串),所以经常被搜索引擎系统用于文本词频统计。它的优点是:利用字符串的公共前缀来减少查询时间,最大限度地减少无谓的字符串比较,查询效率比哈希树高。(From baik... 阅读全文
posted @ 2015-10-13 23:10 Pickle 阅读(1239) 评论(0) 推荐(0) 编辑
摘要: Description:Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal wo... 阅读全文
posted @ 2015-10-13 19:42 Pickle 阅读(464) 评论(0) 推荐(0) 编辑
摘要: Description:Given an Iterator class interface with methods:next()andhasNext(), design and implement a PeekingIterator that support thepeek()operation ... 阅读全文
posted @ 2015-10-12 22:12 Pickle 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页