- 博客(4)
- 收藏
- 关注
原创 二叉树的镜像
#include #include #include #include #include using namespace std; string s; struct node { char data; struct node * left; struct node * right; }; node * creatBTree() { if(s.siz
2015-06-30 15:01:54 365
原创 剑指offer之重建二叉树
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Soluti
2015-06-26 09:41:40 433
原创 剑指offer之空格替换
#include #include #include #include #include using namespace std; class Solution { public: string replaceSpace(string str) { string ans; for(int i = 0, j = 0; i < str.si
2015-06-24 21:05:14 434
原创 桶排序
#include #include #include int n; struct bucket { int b[11]; int count;//每桶元素的个数 }*pbucket; int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; } void bucketsort(int a[]) {
2015-06-01 11:43:20 399
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人