Sort a linked list in O(n log n) time using constant space complexity.这道题属于人生中第一次对链表进行操作,首先,不同于C++中的struct,java中可以用一个类来定义一个数据结构。这道题一看没有任何思路,就看别人的代码,发现...
分类:
其他好文 时间:
2015-04-11 22:23:26
阅读次数:
136
Java里面线程池的顶级接口是Executor,但是严格意义上讲Executor并不是一个线程池,而只是一个执行线程的工具。真正的线程池接口是ExecutorService。比较重要的几个类:ExecutorService真正的线程池接口。ScheduledExecutorService能和Time...
分类:
编程语言 时间:
2015-04-11 22:16:25
阅读次数:
226
一:LeetCode 121 Best
Time to Buy and Sell Stock
题目:
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one t...
分类:
其他好文 时间:
2015-04-11 20:52:40
阅读次数:
213
Can you answer these queries?Time Limit:2000MSMemory Limit:65768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 4027DescriptionA lot of battles...
分类:
其他好文 时间:
2015-04-11 20:41:24
阅读次数:
156
蟠桃记Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41117 Accepted Submission(s): 30915P...
分类:
其他好文 时间:
2015-04-11 20:40:31
阅读次数:
112
2761: [JLOI2011]不重复数字Time Limit:10 SecMemory Limit:128 MBSubmit:2133Solved:825[Submit][Status][Discuss]Description给出N个数,要求把其中重复的去掉,只保留第一次出现的数。例如,给出的数为...
分类:
其他好文 时间:
2015-04-11 19:22:55
阅读次数:
155
题目描述: This time, you are supposed to find A+B where A and B are two matrices, and then count the number of zero rows and columns.输入: The input consist...
分类:
其他好文 时间:
2015-04-11 19:16:11
阅读次数:
170
这些函数很常用,但是不用的话,像我这样的初学者放下就记不清了,这时最好的办法就是去查文档,写一下印象会更深一些1.时间戳函数strtotime():一个就是string to time(我自己这样理解),时间的一个字符串文档中格式:2.date()函数:格式化时间文档中格式:具体格式参考手册,下图举...
分类:
Web程序 时间:
2015-04-11 17:32:51
阅读次数:
162
还是畅通工程
Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 29254 Accepted Submission(s): 13088
Problem Description
某省调查乡村交通状况,得到的统计表中列出了任意两村庄间...
分类:
其他好文 时间:
2015-04-11 16:25:52
阅读次数:
181
Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
解题思路:
n!=2^x*3^y*5^z...,注意到一个2和一个5...
分类:
其他好文 时间:
2015-04-11 16:21:43
阅读次数:
141