题目:Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the...
分类:
其他好文 时间:
2016-05-12 23:57:12
阅读次数:
213
集合特点:元素类型不同、集合长度不同、空间固定不变
框架:为了解决某一个特定的问题,预先设计好的一系列具有继承或实现关系的类与接口集合最核心的接口是:Collection
List和Srt是继承Collection的,是控制单列数据的,Map是Collection简介产生出来的
List(列表)特点:线性(有序)
有序指代的是元素的放置是有顺序的,指通过前一个...
分类:
其他好文 时间:
2016-05-12 23:46:09
阅读次数:
235
容器大体分为两类:Collection和Map。
区别:
1 Collection中存储了一组对象,而Map存储键值对。
2 Collection的子类都实现了iterator这个方法,该方法能返回一个Iterator对象。Collection的具体实现包括List和Set。
区别:
1 List是有序的,元素可以重复的,Set是无序的,元素不可以重复。
2 Set的value最多只能存...
分类:
编程语言 时间:
2016-05-12 23:42:51
阅读次数:
250
#include
#include
#include
using namespace std;
typedef int ElemType;
typedef int Status;
#define OK 1
#define ERROR 0
#define OVERFLOW -2
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
ElemTy...
分类:
其他好文 时间:
2016-05-12 23:31:34
阅读次数:
677
(一)Fragment和Activity的交互一个Fragment的实例总是和包含它的Activity直接相关。
Fragment可以通过getActivity() 方法来获得Activity的实例,然后就可以调用一些例如findViewById()之类的方法。
如: View listView = getActivity().findViewById(R.id.list); 但是注意调用...
分类:
其他好文 时间:
2016-05-12 23:27:30
阅读次数:
127
进入hbase命令行
./hbase shell
查看状态
status
显示hbase中的表
list
创建user表,包含info、data两个列族
create 'user', 'info1', 'data1'
create 'user', {NAME => 'info', VERSIONS => '3'}
向user表中插入信息,row k...
分类:
其他好文 时间:
2016-05-12 23:05:58
阅读次数:
206
mysql常用语句:
查看已经安装的mysql软件
yum list installed | grep mysql
安装rpm格式的mysql包
rpm -i MySQL-5.0.9-0.i386.rpm
rpm格式mysql可选包的安装
rpm -i MySQL-client-5.0.9-0.i386.rpm
rpm -i MySQL-devel-5.0.9...
分类:
数据库 时间:
2016-05-12 22:55:52
阅读次数:
260
(define (append a b)
(if (null? a)
b
(cons (car a) (append (cdr a) (cons (car a) b)))))
(define nil (list))
(define (count-leaves x)
(cond ((null? x) 0)
((not (pair? x)) 1)...
分类:
其他好文 时间:
2016-05-12 22:53:59
阅读次数:
265
比较直观的解法是自顶向下的递归解决,先找到中间节点作为根节点,然后递归左右两部分。所有我们需要先找到中间节点,对于单链表来说,必须要遍历一边,可以使用快慢指针加快查找速度。
代码如下:
但是leetcode中没有编译通过,因为java二叉树中引用为null的节点中值为'#';/**
* Definition for singly-linked list.
* public clas...
分类:
其他好文 时间:
2016-05-12 22:39:42
阅读次数:
157
1.服务端查看有哪些客户端证书
# puppet cert list (--all)
"slave-puppet" (SHA256) A0:BE:9F:85:2F:67:2A:1D:94:D2:A4:4C:8F:2F:6D:2A:C4:F2:33:B4:18:66:1C:6A:D6:AC:10:92:50:4D:A2:D2
2.让客户端生成 ssl 证书(服务端运行)
生产证...
分类:
其他好文 时间:
2016-05-12 22:30:05
阅读次数:
277