在lua当中我们如果要遍历一个tb,有序数组用ipairs,无序的则会用pairs,直接先上代码 --------------------------------- --数组型 --------------------------------- local tb1 = {3,2,1} for i,v
分类:
其他好文 时间:
2016-02-15 12:20:07
阅读次数:
242
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: "
分类:
其他好文 时间:
2016-02-13 23:13:58
阅读次数:
458
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick
分类:
其他好文 时间:
2016-02-08 13:34:05
阅读次数:
370
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick
分类:
其他好文 时间:
2016-02-05 19:02:00
阅读次数:
211
一、 JSON (JavaScript Object Notation)一种简单的数据格式,比xml更轻巧。 Json建构于两种结构: 1、“名称/值”对的集合(A collection of name/value pairs)。不同的语言中,它被理解为对象(object),纪录(record),结
分类:
编程语言 时间:
2016-02-05 11:44:14
阅读次数:
147
Problem Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj.For
分类:
其他好文 时间:
2016-01-28 07:02:02
阅读次数:
134
在cocos2dx-lua中应用pbc解析protobuf协议格式发现,其对嵌套消息的解析很不友好。 经过for pairs循环检验发现,decode方法并没有解析内部嵌套的子消息。进一步检查发现,子消息的输出格式为table:第一个字段为子消息的名字, 第2个字段为一个奇怪的字符串(一般为子消息的...
分类:
其他好文 时间:
2016-01-24 22:28:34
阅读次数:
309
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al...
分类:
其他好文 时间:
2016-01-22 22:09:51
阅读次数:
138
一、 JSON (JavaScript Object Notation)一种简单的数据格式,比xml更轻巧。Json建构于两种结构: 最后再加一种格式在文章的最后显示出来非常少有的格式 1、“名称/值”对的集合(A collection of name/value pairs)。不同的语言中。它.....
分类:
移动开发 时间:
2016-01-20 19:09:07
阅读次数:
193
注意用指针记录节点的前一个节点位置。代码:/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { va...
分类:
其他好文 时间:
2016-01-16 07:35:12
阅读次数:
116