??xml version="1.0" encoding="utf-8" standalone="yes"?>综合电影一区二区三区 ,国产麻豆成人精品,一区二区三区成人http://www.aygfsteel.com/jefflee/zh-cnMon, 19 May 2025 04:36:16 GMTMon, 19 May 2025 04:36:16 GMT60据说是微软的一道面试题http://www.aygfsteel.com/jefflee/archive/2011/05/19/350637.htmlJeff LeeJeff LeeThu, 19 May 2011 10:48:00 GMThttp://www.aygfsteel.com/jefflee/archive/2011/05/19/350637.htmlhttp://www.aygfsteel.com/jefflee/comments/350637.htmlhttp://www.aygfsteel.com/jefflee/archive/2011/05/19/350637.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/350637.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/350637.html|上大多Ch的做法时间复杂度虽然能达?O(n), 但是I间复杂度是O(N) Q题目已l指出N是一个较大的整数Q所以可能不大好?br />想了一下,想了一个空间复杂度是O(m)的算?Q其中m是输入整数数列的长度。设输入的整数数l是arrayQ符合条件的数对的个CؓcountQ初始化?1. 建立hash集合S, 遍历array的前一半元素,对于q一半元素中的Q意一个元素e, 在S中插?N+1 - e 2. 遍历array的后一半元素,对于每一个元素e, 如果e在S中已l存在,则count +13. 遍历l束Q返回count卛_q个法只需遍历一遍输入数l,复杂度ؓO(n) Q只需存储m/2个元素,复杂度ؓO(m) ,如果mq小于NQ这个算法还是有很大改进的?br />Jeff Lee 2011-05-19 18:48 发表评论]]>关于带环的@环链表的两个问题http://www.aygfsteel.com/jefflee/archive/2011/05/15/350267.htmlJeff LeeJeff LeeSun, 15 May 2011 08:10:00 GMThttp://www.aygfsteel.com/jefflee/archive/2011/05/15/350267.htmlhttp://www.aygfsteel.com/jefflee/comments/350267.htmlhttp://www.aygfsteel.com/jefflee/archive/2011/05/15/350267.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/350267.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/350267.html2. 如何扑ֈ链表中的环的W一个节?br />W一个问题很好找Q就是设|两个指?p , q ?其中 p每次向前UM个,q每次向前UM个,如果q能追的上pQ则链表带环Q时间复杂度为O(n), I间复杂度ؓO(1)W二个问题是室友在面某投行IT部门时的题目Q可惜啊Q俺q不了该投行的电(sh)话面试)。这个题目最Ҏ(gu)的做法就是用一个数l记录遍历过的节点,然后W一ơ遍历到已经讉Kq的节点时就可以了。据室友_题目要求I间复杂度ؓO(1) . 因此昄不能用这个方法了?br />我想了一下,一开始想了一个O(n*n)的方法,后来受那个求两个链表W一个公p点的题目的启发,惛_了一个O(n)的算法,大概是q样Q找到环中的L一个节点,q个很容易找Q在判断链表是否包含环的步骤中,当p,q 盔RӞp和q必定在环内,不妨取pQ再设r为p的下一个节?在p和r之间环打断Q这时可以得C个链表?h...p, r...p, (h为链表头l点), 然后再将链表 h..p逆{(此时r..p必然变ؓ r...h)Q求得链表p...h与r..h的第一个公共子节点是所求的炏V最后将p..h逆{回来Q将p和rq接上,卛_得到原链表。空间复杂度为O(1), 旉复杂度ؓO(n).Jeff Lee 2011-05-15 16:10 发表评论]]>求两个各链表的第一个公p?/title>http://www.aygfsteel.com/jefflee/archive/2011/01/31/343802.htmlJeff LeeJeff LeeMon, 31 Jan 2011 03:16:00 GMThttp://www.aygfsteel.com/jefflee/archive/2011/01/31/343802.htmlhttp://www.aygfsteel.com/jefflee/comments/343802.htmlhttp://www.aygfsteel.com/jefflee/archive/2011/01/31/343802.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/343802.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/343802.htmlhttp://zhedahht.blog.163.com/blog/static/254111742008053169567/我想到的是逆{链表再遍历的Ҏ(gu)Q理Z也是O(n)Q但是需要来回逆{两次。?br />q个题的解法也揭CZ链表隐含的一个属性:长度?br />如果有环又该怎么办?Jeff Lee 2011-01-31 11:16 发表评论]]>法D W三??sh)子?/title>http://www.aygfsteel.com/jefflee/archive/2010/12/03/339654.htmlJeff LeeJeff LeeThu, 02 Dec 2010 16:05:00 GMThttp://www.aygfsteel.com/jefflee/archive/2010/12/03/339654.htmlhttp://www.aygfsteel.com/jefflee/comments/339654.htmlhttp://www.aygfsteel.com/jefflee/archive/2010/12/03/339654.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/339654.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/339654.html?/a>虽然会去看的Z很少Q毕竟手边还有第二版的英文版。。但是还是收藏一下。?br />ps: ms ?adobe reader无法打开。。用 foxit 却可以正常打开。?br />Jeff Lee 2010-12-03 00:05 发表评论]]>MonoDevelop 插g开发的单例?/title>http://www.aygfsteel.com/jefflee/archive/2010/12/01/339491.htmlJeff LeeJeff LeeWed, 01 Dec 2010 05:12:00 GMThttp://www.aygfsteel.com/jefflee/archive/2010/12/01/339491.htmlhttp://www.aygfsteel.com/jefflee/comments/339491.htmlhttp://www.aygfsteel.com/jefflee/archive/2010/12/01/339491.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/339491.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/339491.html例子Q也是插入当前日期的小功能。基本没什么问题?br />需要注意的一Ҏ(gu)在最新的MonoDevelop例子会跑不通,出现了下面这个问?div style="background-color: rgb(238, 238, 238); font-size: 13px; border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; width: 98%;">WARNING: The add-in 'MonoDevelop.DateInserter.Samples,2.0' is trying to extend '/MonoDevelop/Ide/Command/Edit', but there isn't any compatible add-in defining this extension point然后插g没法用?br />一开始试了很久,google了好久都没找到答案?br />后来瞟到MonoDevelop.Samples.DateInserter.addin.xml 文gӞ看到q个<Dependencies> <Addin id="Ide" version="2.0"/> </Dependencies> 忽然惛_会不会是q个问题呢,参照其他插g源码的xml文gQ把q个改ؓ<Dependencies> <Addin id="Ide" version="2.4"/> </Dependencies> 发现居然成功了~Jeff Lee 2010-12-01 13:12 发表评论]]>Monodevelop ~译 Python 插ghttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339379.htmlJeff LeeJeff LeeTue, 30 Nov 2010 04:53:00 GMThttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339379.htmlhttp://www.aygfsteel.com/jefflee/comments/339379.htmlhttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339379.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/339379.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/339379.html其实写python的话QPyDev插g已经相当优秀了,在MonoDevelop上装Python插g主要是ؓ了学?fn)一下mono~程Q既然要学习(fn)Q自然要学会从源码编译插件?br />~译q程其实也是相当单~到monodevelop官网下蝲打包好的源代?/a>tar jxvf monodevelop-python-2.4.tar.bz2cd monodevelop-python-2.4source mono-2.8-environment./configuremakesudo make install关于monodevelop python插g的用法请参考作者的主页上的教程可以看到q个插g目前已经实现了代码补全的功能QM上来说跟PyDev的差距还是相当大的,改进的地方也很多。打接下来修改一下它的源码,应该是一个不错的学习(fn)q程~Jeff Lee 2010-11-30 12:53 发表评论]]>Ubuntu 10.04 ~译 monodevelophttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339368.htmlJeff LeeJeff LeeTue, 30 Nov 2010 03:33:00 GMThttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339368.htmlhttp://www.aygfsteel.com/jefflee/comments/339368.htmlhttp://www.aygfsteel.com/jefflee/archive/2010/11/30/339368.html#Feedback2http://www.aygfsteel.com/jefflee/comments/commentRss/339368.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/339368.html本文实验环境Q?vmware 7.1 + ubuntu 10.04, 内存 1Gȝ来说~译安装monodevelop 2.4需要两个步骤:1. 安装mono 2.8 parallel environment : mono官方没提供deb包下载,不过有开发者打包好了ubuntu安装包,具体参见q个博客 Q?a > Mono 2.8 parallel environment debian/ubuntu package上面也有下蝲链接Q下载之后命令行sudo dpkg -i mono-2.8-parallel-environment.deb 或者直接双d?br />2. ~译安装monodevelop Q?br />到monodevelop 官方|站下蝲monodevelop源码解压之后按照linux~译、安装的正常步骤可以了Q具体不再细?br />source mono-2.8-environmenttar jxvf monodevelop-2.4.1.tar.bz2cd monodevelop-2.4.1./configuremakesudo make installsource mono-2.8-enrironment的作用是Z让系l用mono parallel environment?/configure可能会提C缺工P直接apt-get 可以了?br />Jeff Lee 2010-11-30 11:33 发表评论]]>windows下Groovy 中文路径问题http://www.aygfsteel.com/jefflee/archive/2008/06/21/209709.htmlJeff LeeJeff LeeSat, 21 Jun 2008 09:58:00 GMThttp://www.aygfsteel.com/jefflee/archive/2008/06/21/209709.htmlhttp://www.aygfsteel.com/jefflee/comments/209709.htmlhttp://www.aygfsteel.com/jefflee/archive/2008/06/21/209709.html#Feedback1http://www.aygfsteel.com/jefflee/comments/commentRss/209709.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/209709.html如果你用带windows installer的groovy版本安装groovyӞpȝ会自动加上groovy文gcd信息Q这样你可以通过双击groovy脚本文g来执行groovy脚本了。但是我在用过E出C一个问题,那就是如果脚本文件的路径含有中文字符ӞgroovyL提示找不到文Ӟ脚本自然也不能执行(我清楚在windows中文版上是否会出现这个问题)。原因我估计?GROOVY_HOME\bin\groovy.exe没有很好的处理中文字W,D了groovy解释器没办法扑ֈ脚本文g。解x法就是把groovycd文g的打开E序?GROOVY_HOME\bin\groovy.exeҎ(gu) GROOVY_HOME\bin\groovy.bat。具体步骤如下: 1、在windows文g理器中打开选项卡:tools -> Folder Options -> File TypesQ?选中groovy文gcd 2、点?Advanced 选项Q会出现如下界面 3、选中open, 然后点击Edit按钮Q会出现如下界面 4、把groovy.exeҎ(gu) groovy.bat可以了Q其他的不要改动 Jeff Lee 2008-06-21 17:58 发表评论]]>Python 常用模块在线文http://www.aygfsteel.com/jefflee/archive/2008/06/21/209661.htmlJeff LeeJeff LeeSat, 21 Jun 2008 03:10:00 GMThttp://www.aygfsteel.com/jefflee/archive/2008/06/21/209661.htmlhttp://www.aygfsteel.com/jefflee/comments/209661.htmlhttp://www.aygfsteel.com/jefflee/archive/2008/06/21/209661.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/209661.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/209661.htmlhttp://pydoc.org/2.5.1/os.htmlos.name的|windowsQntlinuxQposix2、sys: http://pydoc.org/2.5.1/sys.htmlJeff Lee 2008-06-21 11:10 发表评论]]>MySQL 聚集函数 (aggregate function)http://www.aygfsteel.com/jefflee/archive/2008/06/20/209463.htmlJeff LeeJeff LeeFri, 20 Jun 2008 07:21:00 GMThttp://www.aygfsteel.com/jefflee/archive/2008/06/20/209463.htmlhttp://www.aygfsteel.com/jefflee/comments/209463.htmlhttp://www.aygfsteel.com/jefflee/archive/2008/06/20/209463.html#Feedback0http://www.aygfsteel.com/jefflee/comments/commentRss/209463.htmlhttp://www.aygfsteel.com/jefflee/services/trackbacks/209463.htmlFunctionDescriptionAVG()Returns a column's average valueCOUNT()Returns the number of rows in a columnMAX()Returns a column's highest valueMIN()Returns a column's lowest valueSUM()Returns the sum of a column's values聚集函数q回的是某一个单独的|而不是象有些sql语句一栯回多行的记录?br />2、接下来我们用一?a href="/Files/jefflee/bank.zip">bank来实验学?fn)MySQL?br />Q?Q求出所有银行贷出去的款Ҏ(gu)额Q?div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">SELECT sum(amount) as sum FROM loan;Q?Q求出最大一W贷ƾ业务的金额Q?br />SELECT max(amount) AS max_amount FROM loan;Jeff Lee 2008-06-20 15:21 发表评论]]> վ֩ģ壺 »Ȱ| 뵺| ǭ| | | | ¡| ȫ| ˳| | | | | פ| ƽ| | | | 绯| | | | ʱ| ˳| ɽ| | | | | | ̨ɽ| ͬ| | | | | | | | | |
Function
Description
AVG()
Returns a column's average value
COUNT()
Returns the number of rows in a column
MAX()
Returns a column's highest value
MIN()
Returns a column's lowest value
SUM()
Returns the sum of a column's values