- 博客(6)
- 收藏
- 关注
原创 求字符串的所有子集2
// 求字符串的所有子集2.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "string.h"#include #include #include using namespace std;/** ABCD* ABC* ABD*
2013-02-24 14:51:14 1771
原创 在一个字符串中找出包含特定字符串的最小窗口
// 在一个字符串中找出包含特定字符串的最小窗口.cpp : Defines the entry point for the console application.// 同时请产考这个链接 http://blog.csdn.net/yuucyf/article/details/6714235#include "stdafx.h"#include #include void FM
2013-02-20 00:49:06 1373
原创 用二进制方式打印unsigned int
void bin(unsigned int &A){ for (i = 1 0; i >>= 1) { (i & A)?printf("1"): printf("0"); } printf("\n");}若输入的是 15, 打印的结果是 0000000000001111;void bin2(unsigned int &A){ i
2013-02-16 21:27:37 1475
转载 判断一个括号字符串是否配对出现
转自出处Stack *s = new Stack();for (int i = 0; i < strlen(str): i++){ if ((str[i] == '{') || (str[i] == '[') || (str[i] == '(')) s->push(str[i]); else { char tp = s->po
2013-02-13 00:04:25 1658
原创 输出二叉树中节点最多的层
// 输出二叉树中节点最多的层.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include int maxLevel(node *root, *maxNodes) { int max_nodes, max_level, cur_level; if (r
2013-02-12 23:58:15 1492
转载 输入一个数,按bit输出小于等于整个数的所有数
转自出处You have given n numbers from 1 to n. You have to sort numbers with increasing number of set bits.for ex: n=5.output: 1,2,4,3,5Note: If you have two number with equal number of set bit
2013-02-12 22:58:22 638
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人