摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.Input:(2 -> 4 -> 3) + (5 -> 6 -> 4)Output:7 -> 0 -> 8这题比较简单,注意链表相关操作就可以了。刚 阅读全文
posted @ 2013-09-25 15:35 果汁果粒 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 从头开始做起吧,省得自己挑肥拣瘦。虽然网上有很多leetcode的解题报告了,自己写写还是能够加深记忆。---------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 the target, where index1 must be less than index2. 阅读全文
posted @ 2013-09-25 12:46 果汁果粒 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 这个题目可以利用最大直方图的做法,遍历每一行O(n),把每一行看成以这一行为底的直方图,如1 0 0 1 11 0 1 1 10 1 0 1 0 第一行可以看成 height = [1,0,0.1,1] 的直方图,第二行看成height = [2,0,1.2,2],第三行看成height = [0,1,0,3,0] 。这样就可以利用求最大直方图的算法来解决。算法复杂度为O(n)*O(n)=O(n2)。 在把二维数组matrix转化为height的二维数组时,根据matrix[i][j]=='0'进行转化,不是想当然的加和。 阅读全文
posted @ 2013-09-22 17:01 果汁果粒 阅读(154) 评论(0) 推荐(1) 编辑
摘要: 最原始的html dom方法:通过id使用getElementById方法定位到某个元素。但是不可能给页面的每个元素都加Id,所以就需要用到选择器对页面元素进行定位和选择。Ext的选择器主要有以下几种,要注意区分它们返回的类型:HTMLElement对象 Element对象 CompositeElementLite对象 CompositeElement对象 数组或Document对象1、Ext.query() 返回的是:一个由 HTMLElement对象 组成的数组2、Ext.get() 和 Ext.fly() 返回的是:Element对象 Ext.get('MyId')... 阅读全文
posted @ 2013-09-18 15:47 果汁果粒 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of each bar is 1, given height =[2,1,5,6,2,3].The largest rectangle is shown in the shaded area, which has ar 阅读全文
posted @ 2013-09-16 22:16 果汁果粒 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 相对最优:SELECT ASSETCHANGEAPPLYINFO.*,ASSETCHANGEINFO.OPERATION FROM ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO INNER JOIN ASSETCHANGEAPPLYINFO ON ASSETCHANGEINFO_ASSETCHANGEAPPLYINFO.ASSET_CHANGE_APPLYINFO_ID = ASSETCHANGEAPPLYINFO.ID LEFT JOIN ASSETCHANGEINFO ON ASSETCHANGEINFO_ASSETCHANGEAPPLYIN... 阅读全文
posted @ 2013-08-13 16:18 果汁果粒 阅读(1135) 评论(0) 推荐(0) 编辑
摘要: 选择框加载数据:尝试了combo ,链接viewsta.js有问题:只显示第一个字符,其中还有一些属性下面知识点没介绍到。------------------------------------------最终用下面方法完成:1、 加onchange 2、加Ajax异步数据传输:function getNewData(){//alert($("groupName").value+"~~!");var t=$("groupName").value;new Ajax.Request( '../statistics/viewstat 阅读全文
posted @ 2013-08-13 16:07 果汁果粒 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 方法一:对前端传到后台的中文进行两次编码,服务器端进行一次解码。(更经常用encodeURIComponent编码)编码时: tree.on('beforeload',function(){ tree.loader.dataUrl='getvisibletasktreegrid.action?taskName='+encodeURI(encodeURI($("tName").value))+'&operator='+$("tOperator").value+'&province=&# 阅读全文
posted @ 2013-08-13 15:57 果汁果粒 阅读(243) 评论(0) 推荐(0) 编辑