A Little Pony and Crystal
Mine
题意:给一个奇数n,打印菱形图案,整个图形占n*n格。
例如--->输入3,则打印图案如下
*D*
DDD
*D*
算法:
由中间那行为n个D,以t = n/2为界先打上半边,每一行由D隔开的*的个数为离中间行的距离。
D的个数为n-当前行离中间行的距离*2。
下半边同理。
#in...
分类:
其他好文 时间:
2014-08-18 16:20:22
阅读次数:
249
系列文章导航:LINQ to SQL语句(1)之WhereLINQ to SQL语句(2)之Select/DistinctLINQ to SQL语句(3)之Count/Sum/Min/Max/AvgLINQ to SQL语句(4)之JoinLINQ to SQL语句(5)之Order ByLINQ ...
分类:
数据库 时间:
2014-08-18 12:58:42
阅读次数:
255
Magento新站上线伊始,不料在邮件上遇到了问题。此时常用的邮件模板已经编辑完毕,诸如New Account, New Order, Password Forget等。 CentOS下发送邮件很简单的,只需安装sendmail就可以了,安装sendmail也很简单,只需yum install se...
分类:
其他好文 时间:
2014-08-18 12:24:04
阅读次数:
183
题目大意:
按照题意将数用二叉树的形式表示出来。将二叉树按照要求形式输出。
解题思路:
由于有图示,可以轻易看出这个顺序跟卡特兰数列有关。且对于任意一个树的任意子树来说,右子树相当于分针,左子树相当于秒针。也就是说当右子树要变换到下一种状态时,左子树要将它所能变换的状态全变换完才可以。
下面是代码:
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2014-08-18 09:16:33
阅读次数:
185
Potted Flower
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 4186
Accepted: 1581
Description
The little cat takes over the management of a new park. There...
分类:
其他好文 时间:
2014-08-17 18:39:42
阅读次数:
350
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and ...
分类:
其他好文 时间:
2014-08-17 18:25:02
阅读次数:
233
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,...
分类:
其他好文 时间:
2014-08-17 15:32:12
阅读次数:
131
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For e...
分类:
其他好文 时间:
2014-08-17 15:31:52
阅读次数:
221
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路:取数组的中点为树的根,前半部分为左子树,后半部分为右子树。 1 class Solution { 2...
分类:
其他好文 时间:
2014-08-17 13:02:12
阅读次数:
210
1.在查询结果中显示列名:a.用as关键字:select name as '姓名' from students order by ageb.直接表示:select name '姓名' from students order by age2.精确查找:a.用in限定范围:select * from s...
分类:
数据库 时间:
2014-08-17 12:57:02
阅读次数:
273