04 2015 档案
摘要:实验室里好热,空气仿佛一点就着做梦一样的回家了,虽然只待了两天但是满足了,这两天没敢多睡一秒钟,每一秒对我来说都很奢侈一切似乎回到小时候,但一切又不一样爸妈脸上爬满了皱纹,爷爷奶奶渐渐老去,才意识到自己已不是小孩子,岁月苍老了爸妈的容颜,成就了健康平安的我,自己长大,父母老去,这种自然规律好残酷。想...
阅读全文
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
阅读全文
摘要:Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
阅读全文
摘要:论文还是没有赶完,我也是醉了,做什么事情永远不要高估自己的效率,另外计划永远赶不上变化!今天是一周的开始,上午和老师商讨会议茶歇和礼品的事情耽误了一上午,下午一直在准备例会要汇报的东西,晚上实验室聚餐,时间过得好快啊,一年一年又一年,不知不觉我马上就要开始找工作了。有时候觉得例会特别耽误时间,简直就...
阅读全文
摘要:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.这道题其实...
阅读全文
摘要:Given a linked list, determine if it has a cycle in it.Follow up: Can you solve it without using extra space?摘自剑指offer:当用一个指针遍历链表不能解决问题的时候,可以尝试用两个指针来遍...
阅读全文
摘要:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
阅读全文
摘要:当看到北京十一学校的信息之后,内心小火苗蠢蠢欲动了好久,从13号晚上开始,一直到14号晚上就一直在弄简历的事情,好不容易弄好发了过去,心里反而更加焦躁和恐慌。项目经验,不知如何看起啊。今天是周三,上午莫名其妙弄了一些mysql的东西,下午就再也看不进书去,就去找同学玩,刚巧碰上她们大赛交材料,于是就...
阅读全文
摘要:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.这道题是合并两个有...
阅读全文
摘要:Sort a linked list using insertion sort.这道题是用链表做插入排序。虽然之前数据结构中学习了链表的插入删除等,但那些都是最简单的基本操作,只是给出一个节点,直接给出插入位置。首先,插入排序的思想是,每次将一个元素插入到前面已排序的有序的链表中,因此首先要找到需要...
阅读全文
摘要:我在想人与人之间为什么会有差距,除去家庭背景和父母积累的财富之外,我觉得一个人一定要能够控制住自己的生活!但凡成功人士,必定都将自己的时间管理的很好。有时候早晨虽然醒来,但是浏览浏览网页,看看邮件,聊会天,一天就又过去了,每一次在走回宿舍的路上开始反思和懊悔,自己再也不能这样下去了,今天一定要早睡,...
阅读全文
摘要:Sort a linked list in O(n log n) time using constant space complexity.这道题属于人生中第一次对链表进行操作,首先,不同于C++中的struct,java中可以用一个类来定义一个数据结构。这道题一看没有任何思路,就看别人的代码,发现...
阅读全文
摘要:Implement int sqrt(int x).Compute and return the square root of x.这道题也属于二分查找的变形主流的方法是用牛顿插值,牛顿法的思想参考http://blog.csdn.net/StarCXDJ/article/details/18051...
阅读全文
摘要:Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
阅读全文
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t...
阅读全文
摘要: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 or...
阅读全文
摘要: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 or...
阅读全文
摘要:二分查找经常在有序数列中查找某个特定的位置。因此使用二分查找应满足以下两个条件:1:存储在数组中2:有序排列。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。Given a sorted array of integers, find the starting and endi...
阅读全文
摘要:Given 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 nu...
阅读全文
摘要:Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
阅读全文
摘要:Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],...
阅读全文
摘要:清明三天假眼瞅着就到了最后一天的最后一晚上,在宿舍睡了三天也是醉生梦死。大概是因为逃避与恐惧,导致不想学术。无尽的烦躁与负能量我想这种浮躁大抵是因为自己活得太压抑与没底气有关。只是听到身边的人,谁谁谁今天又刷了几道题,谁谁谁今天又拿到了哪个公司的实习offer,谁谁谁今天又发了什么论文,谁谁谁今天又...
阅读全文
摘要:Given an unsorted integer array, find the first missing positive integer.Given[1,2,0]return3,and[3,4,-1,1]return2.这道题最开始理解错了意思,以为是找出第一个不是非负数的数,心想,卧槽岂不...
阅读全文
摘要:今天看到一个很有意思的情况,如果希望用toString方法返回对象的地址的时候,可能会考虑使用this关键字,但是这个时候会出现一个问题,编译器看到string对象后面跟着一个“+”而后面不是String对象,编译器试图将this转换为string对象,,通过调用this的toString方法,于是...
阅读全文
摘要:You may assume that A has enough space (size that is greater or equal tom+n) to hold additional elements from B. The number of elements initialized in...
阅读全文

浙公网安备 33010602011771号