摘要: GROUP BY子句,HAVING子句。聚合函数:COUNT();SUM();AVG();MAX();MIN().1.GROUP BY子句的应用select state from MemberDetails group by state; --严格来说,select distinct也能完成这... 阅读全文
posted @ 2015-05-26 22:58 wy1290939507 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 基本思想:通过一趟排序将待排列记录分割成独立的两部分,其中的一部分均比另一部分小,然后分别对这两个部分进行排序,使整个序列有序。可选择第一个记录pivotkey作为枢纽,设置两个指针low和high,初值分别为low和high。首先从high所指的位置向前搜索找到第一个比pivotkey小的值,并且... 阅读全文
posted @ 2015-05-24 21:17 wy1290939507 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-05-24 18:37 wy1290939507 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2015-05-21 22:15 wy1290939507 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 如果一个数的每个位的整数的平方和等于1,则为happy numberExample:19 is a happy number12+ 92= 8282+ 22= 6862+ 82= 10012+ 02+ 02= 1#include#include#include using namespace std... 阅读全文
posted @ 2015-05-21 11:03 wy1290939507 阅读(137) 评论(0) 推荐(0) 编辑
摘要: (一)数学函数1.abs(x);2.POWER(expression,power_raise_to);3.SQRT(expression_to_square_root); //平方根4.rand(); //生成随机数,但是不保证生成的是唯一值5.ceiling(); //向上舍入到临近的最大整数... 阅读全文
posted @ 2015-05-20 16:13 wy1290939507 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 一.标准化数据库的设计中,最小化数据冗余和数据库的效率之间存在一个折衷。1.第一范式:定义所需要的数据项,将相关的数据项放置在一个表中。确保没有重复的数据组。(可以通过将数据划分到多个表中,来删除重复的数据)确保存在一个主键。主键:记录的唯一标示符。可以添加一个新列,或者使用现有的一个或者多个列,只... 阅读全文
posted @ 2015-05-15 18:56 wy1290939507 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/hackbuteer1/article/details/74624471.递归算法解决数组全排问题思路:为方便起见,用123来示例下。123的全排列有123、132、213、231、312、321这六种。首先考虑213和321这二个数是如何得出的。显然... 阅读全文
posted @ 2015-05-06 18:52 wy1290939507 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 1.判断下列程序能不能正确输出#include#includevoid New(char* p){ p=new char[5];}void main(){ char *p=NULL; New(p); strcpy(p,"hello"); //需要头文件stdio.h和s... 阅读全文
posted @ 2015-05-05 15:47 wy1290939507 阅读(171) 评论(0) 推荐(0) 编辑
摘要: //赫夫曼树和赫夫曼编码。可运行代码#includeusing namespace std;typedef struct{ unsigned int weight; unsigned int parent,lchild,rchild;}HTNode,*HuffmanTree; ... 阅读全文
posted @ 2015-05-04 19:51 wy1290939507 阅读(229) 评论(0) 推荐(0) 编辑