Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))...
分类:
编程语言 时间:
2014-07-12 13:02:18
阅读次数:
248
==========================================================================================v3.2.2 upgrade :============================================...
分类:
其他好文 时间:
2014-07-12 00:30:45
阅读次数:
585
Method 4: Gets the value of element number i
For example, if list is {22, 33, 44, 55, 66, 77, 88, 99}, then get(list, 2) will return 44.
Solution 1:
static int get(Node list, int i) {
if (i < 0) ...
分类:
其他好文 时间:
2014-07-08 14:07:52
阅读次数:
262
简单的插入排序,总是超时,暂且放在这记录一下。
class Solution:
# @param head, a ListNode
# @return a ListNode
def insertionSortList(self, head):
if head == None or head.next == None:
return head
psuhead...
分类:
编程语言 时间:
2014-07-06 11:52:20
阅读次数:
230
链表的归并排序
超时的代码
class Solution:
def merge(self, head1, head2):
if head1 == None:
return head2
if head2 == None:
return head1
# head1 and head2 point to the same link list
if head1 == he...
分类:
编程语言 时间:
2014-07-06 09:09:51
阅读次数:
275
给定一个点,除该点之外的其他所有点中,与该点的关系要么是共线,要么就是共点,也就是两点重合。
共线有三种情况:水平共线,垂直共线,倾斜的共线。合并下这三种情况就是斜率存在的共线和斜率不存在的共线。
那么我们的任务就是针对每个点,找出与其共线的这些情况中,共线最多的点的个数。
注意:最终的结果别忘了加上共点的个数。
class Solution:
def maxPoints(self, p...
分类:
编程语言 时间:
2014-07-05 23:52:29
阅读次数:
402
There's a much simpler solution for this. Try running the following command:sudo /usr/sbin/DevToolsSecurity --enable
分类:
数据库 时间:
2014-07-05 22:43:50
阅读次数:
451
Given two integers n and k, return all possible combinations of k numbers out of 1 ...n.For example,If n = 4 and k = 2, a solution is:[ [2,4], [3,4...
分类:
其他好文 时间:
2014-07-05 22:10:53
阅读次数:
226
1 public class Solution { 2 public void sortColors(int[] A) { 3 int len=A.length; 4 int beg=0; 5 int end=len-1; 6 ...
分类:
其他好文 时间:
2014-07-05 21:34:36
阅读次数:
203
参考:0开方 是 01的开方式 12的开方式 1.43.的开方=(1.4+3/1.4)/2牛顿迭代法:学习自http://blog.csdn.net/youwuwei2012/article/details/34075241public class Solution { public int ...
分类:
其他好文 时间:
2014-07-05 21:25:28
阅读次数:
203