Given an array where elements are sorted in
ascending order, convert it to a height balanced BST./** * Definition for binary
tree * public class TreeN...
分类:
其他好文 时间:
2014-06-11 21:58:10
阅读次数:
300
ssh
narnia3@narnia.labs.overthewire.org密码:OOXX(上一关拿到的密码)cat narnia3.c#include
#include #include #include #include #include #include int main(int argc....
分类:
其他好文 时间:
2014-06-11 09:59:03
阅读次数:
347
public voidnotifyDataSetChanged()Added inAPI
level 1Notifies the attached observers that the underlying data has been changed
and any View reflecting ...
分类:
移动开发 时间:
2014-06-11 07:44:51
阅读次数:
270
Given a singly linked list where elements are
sorted in ascending order, convert it to a height balanced BST.public class
Solution { /** Convert th...
分类:
其他好文 时间:
2014-06-10 00:22:44
阅读次数:
259
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-06-08 15:30:28
阅读次数:
227
题目:convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR".
解题思路:这个是个纯粹找规律的题,其他没啥特殊的。下面的例子nRows=4;
找规律按照数组小标开始,寻找下标出现的规律,
1. 第一行和最后一行相邻元素下标之差为 2*nRows-2;
2. 除过第一行和最后一行,其余行要多一个元素,该元素出现的下标和行号有关,比如5 = 1 + 6 - 2,可以总结出规律为 j + 2*nRows-2 - 2*i;
关于 i 和 j 看以看下面...
分类:
其他好文 时间:
2014-06-08 09:11:57
阅读次数:
230
在Froyo(android 2.2,API
Level:8)中引入了android:installLocation.通过设置该属性可以使得开发者以及用户决定程序的安装位置.android:installLocation隶属于AndroidManifest.XML中的manifest节点.如下所.....
分类:
移动开发 时间:
2014-06-08 07:39:24
阅读次数:
384
Spiral MatrixGiven a matrix of m x n elements
(m rows, n columns), return all elements of the matrix in spiral order.For
example, Given the following ...
分类:
其他好文 时间:
2014-06-07 22:57:31
阅读次数:
236
/* 参数说明: pi_program_name 程序名称 pi_directory
写入日志文件所在的目录 pi_file 日志文件名称,必须存在 pi_log_level 日记级别,INFO、WARN、FATAL pi_write_to
...
分类:
数据库 时间:
2014-06-07 22:09:19
阅读次数:
368
Given an array withnobjects colored red, white
or blue, sort them so that objects of the same color are adjacent, with the
colors in the order red, wh...
分类:
其他好文 时间:
2014-06-07 20:11:53
阅读次数:
234