码迷,mamicode.com
首页 >  
搜索关键字:pairs    ( 1028个结果
Codeforce Circle Line 环形数据操作
The circle line of the Berland subway has n stations. We know the distances between all pairs of neighboring stations: d1 is the distance between the 1-st and the 2-nd station; d2 is the d...
分类:其他好文   时间:2014-07-22 23:05:14    阅读次数:302
Lua基础(二)——表
表 a = { } b = { x = 1, ["hello, "] = "world!" } a.astring = "ni, hao!" a[1] = 100 a["a table"] = b function foo() end function bar() end a[foo] = bar --分别穷举表a和b for k, v in pairs(a) do print(k, "=>",...
分类:其他好文   时间:2014-07-22 23:00:33    阅读次数:261
C# CacheHepler Class
internal class CacheHelper { /// /// Insert value into the cache using /// appropriate name/value pairs /// //...
分类:其他好文   时间:2014-05-09 04:19:56    阅读次数:246
【Leetcode】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: "((()))", "(()())", "(())()", "()(())", "()()...
分类:其他好文   时间:2014-05-09 02:29:07    阅读次数:302
Swap Nodes in Pairs
Link:http://oj.leetcode.com/problems/swap-nodes-in-pairs/Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2-...
分类:其他好文   时间:2014-05-05 22:45:37    阅读次数:331
C - Minimum Inversion Number
DescriptionThe inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of ....
分类:其他好文   时间:2014-05-05 11:42:13    阅读次数:276
[leetcode]Swap Nodes in Pairs @ Python
原题地址:http://oj.leetcode.com/problems/swap-nodes-in-pairs/题意:将链表中的节点两两交换。Given1->2->3->4, you should return the list as2->1->4->3.解题思路:这题主要涉及到链表的操作,没什么...
分类:编程语言   时间:2014-05-01 06:44:21    阅读次数:339
《Cracking the Coding Interview》——第17章:普通题——题目12
2014-04-29 00:04题目:给定一个整数数组,找出所有加起来为指定和的数对。解法1:可以用哈希表保存数组元素,做到O(n)时间的算法。代码: 1 // 17.12 Given an array of integers and target value, find all pairs in ...
分类:其他好文   时间:2014-04-29 15:08:13    阅读次数:469
1028条   上一页 1 ... 101 102 103
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!