码迷,mamicode.com
首页 >  
搜索关键字:pairs    ( 1028个结果
2015.04.01 Leetcode Generate Parentheses
LeetCode - Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()" 题解: 需要用dfs -backtracking. 给定的n为括号对,也就是有n个...
分类:其他好文   时间:2015-04-02 13:30:32    阅读次数:158
【LeetCode OJ】Swap Nodes in Pairs
题目:Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space...
分类:其他好文   时间:2015-04-02 10:31:49    阅读次数:114
DP VK Cup 2012 Qualification Round D. Palindrome pairs
题目地址:http://blog.csdn.net/shiyuankongbu/article/details/10004443 1 /* 2 题意:在i前面找回文子串,在i后面找回文子串相互配对,问有几对 3 DP:很巧妙的从i出发向两头扩展判断是否相同来找回文串 4 ...
分类:其他好文   时间:2015-04-01 21:30:11    阅读次数:119
Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()...
分类:其他好文   时间:2015-04-01 11:25:47    阅读次数:110
求拓扑排序的数量,例题 topcoder srm 654 div2 500
周赛时遇到的一道比较有意思的题目:Problem StatementThere are N rooms in Maki's new house. The rooms are numbered from 0 to N-1. Some pairs of rooms are connected by bi...
分类:编程语言   时间:2015-04-01 11:10:30    阅读次数:159
【SICP练习】136 练习3.67
练习3-67原文Exercise 3.67. Modify the pairs procedure so that (pairs integers integers) will produce the stream of all pairs of integers (i,j) (without the condition i < j). Hint: You will need to mix in...
分类:其他好文   时间:2015-03-29 10:55:03    阅读次数:160
【SICP练习】135 练习3.66
练习3-66原文Exercise 3.66. Examine the stream (pairs integers integers). Can you make any general comments about the order in which the pairs are placed into the stream? For example, about how many pairs...
分类:其他好文   时间:2015-03-29 10:55:03    阅读次数:110
【SICP练习】137 练习3.68
练习3-68原文Exercise 3.68. Louis Reasoner thinks that building a stream of pairs from three parts is unnecessarily complicated. Instead of separating the pair (S0,T0) from the rest of the pairs in the fir...
分类:其他好文   时间:2015-03-29 10:52:16    阅读次数:136
[LeetCode 22] Generate Parentheses
题目链接:generate-parentheses import java.util.ArrayList; import java.util.List; /** * Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. ...
分类:其他好文   时间:2015-03-28 08:49:39    阅读次数:105
Generate Parentheses
题目描述:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set i...
分类:其他好文   时间:2015-03-20 23:21:33    阅读次数:248
1028条   上一页 1 ... 82 83 84 85 86 ... 103 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!