Spiral MatrixGiven a matrix ofmxnelements
(mrows,ncolumns), return all elements of the matrix in spiral order.For
example,Given the following matrix:[...
分类:
其他好文 时间:
2014-05-12 20:04:43
阅读次数:
268
Given a singly linked list where elements are
sorted in ascending order, convert it to a height balanced BST.1.
将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:
其他好文 时间:
2014-05-12 05:53:09
阅读次数:
367
【转】 tomcat下各文件夹的作用
tomcat下有9个目录,分别是bin,common,conf,logs,server,shared,temp,webapps,work
目录,现在对每一目录做介绍。tomcat根目录在tomcat中叫,文章中把tomcat解压后...
分类:
其他好文 时间:
2014-05-10 08:23:14
阅读次数:
343
OSIP在定义多线程的时候,需要添加锁,如果没有使用到多线程,就没有使用到锁的功能。文件代码:osip_fifo.h/***Structureforreferencingafifo.*@varosip_fifo_t*/typedefstructosip_fifoosip_fifo_t;/***Structureforreferencingafifo.*@structosip_fifo*/structosip_fifo{#if..
分类:
编程语言 时间:
2014-05-10 04:10:53
阅读次数:
640
循环引用:引用计数是一种便利的内存管理机制,但它有一个很大的缺点,那就是不能管理循环引用的对象。一个简单的例子如下:#include#include#include#includeclassparent;classchildren;typedefboost::shared_ptr
parent_pt...
分类:
其他好文 时间:
2014-05-09 13:01:22
阅读次数:
326
Given an array S of n integers, are there
elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the
array which gives the sum of ...
分类:
其他好文 时间:
2014-05-09 10:27:29
阅读次数:
449
Html.RenderPartial与Html.RenderAction这两个方法都是用来在界面上嵌入用户控件的。Html.RenderPartial是直接将用户控件嵌入到界面上:或注意:用第一种方法时,用户控件必须放在调用者同一目录下,也可以放在View/Shared中。Html.RenderAc...
分类:
Web程序 时间:
2014-05-09 08:58:42
阅读次数:
270
原地归并。下面是AC代码: 1 public void merge(int A[], int m,
int B[], int n) { 2 3 int len = A.length; 4 //first copy m elements of A...
分类:
其他好文 时间:
2014-05-09 05:59:54
阅读次数:
297
1. Write a procedure count-list to count the
number of elements in a list1 (defun count-list (numbers)2 (if (null numbers) 03
(+ 1 (co...
分类:
其他好文 时间:
2014-05-09 05:41:41
阅读次数:
307
swap分区交换空间,正是因为交换空间的存在,使我们的内存可以过载使用。在物理买内存不足的情况下,拿swap来应急。free:查看当前系统上物理内存和交换空间的使用情况。-m[root@vim-ap~]#freetotalusedfreesharedbufferscachedMem:1026868419232607636023704284224-/+buffers/..
分类:
系统相关 时间:
2014-05-08 16:55:16
阅读次数:
435