11 2016 档案

状态机学习(二)解析INI文件
摘要:题目来自<系统程序员成长计划> 作者:李先静. 状态变化如下 运行结果 group = GRPkey = name. value = defkey = data. value = 2016.11.29comment = this is a commentkey = str. value = this 阅读全文

posted @ 2016-11-29 11:13 itdef 阅读(434) 评论(0) 推荐(0)

链表练习
摘要:#include <memory> #include <iostream>#include <chrono>#include <thread>using namespace std; struct ListNode { int val; shared_ptr<ListNode> next;}; bo 阅读全文

posted @ 2016-11-27 21:19 itdef 阅读(157) 评论(0) 推荐(0)

C++11 删除链表重复数值
摘要:#include #include #include #include using namespace std; struct ListNode{ int val; shared_ptr next; }; bool InsertNode(shared_ptr& insertPos,int val) { shared_ptr node(new ListNode); if (!n... 阅读全文

posted @ 2016-11-25 22:29 itdef 阅读(347) 评论(0) 推荐(0)

大数相乘练习
摘要:#include #include using namespace std; int* BigNumberMulti(int arr1[], int length1, int arr2[], int length2) { int len = length1 + length2; int* ret = new int[len]; memset(ret, 0, sizeof(int)... 阅读全文

posted @ 2016-11-25 11:24 itdef 阅读(183) 评论(0) 推荐(0)

状态机学习(三)解析JSON1
摘要:来自 从零开始的 JSON 库教程 从零开始教授如何写一个符合标准的 C 语言 JSON 库 作者 Milo Yip https://zhuanlan.zhihu.com/json-tutorial 根据第一课教程 自己重新编写 做了一点修改 加深学习印象 测试效果 12/12 (100%) pas 阅读全文

posted @ 2016-11-24 15:23 itdef 阅读(520) 评论(0) 推荐(0)

状态机学习(一)统计字符
摘要:题目来自<系统程序员成长计划> 作者:李先静. 逐个字符扫描 根据是否为字母决定当前状态 由单词内状态切换到单词外 计数字符加1 改进版 计数以外还讲单词放入容器 运行结果 1919this s a test Hello World Welcome to the real world it suck 阅读全文

posted @ 2016-11-24 15:22 itdef 阅读(295) 评论(0) 推荐(0)

二分查找练习
摘要:#include using namespace std; int arr1[] = { 1,2,3,4,5,6,7,8,9 }; int arr2[] = { 1,1,1,2,3,3,4,6,98 }; int MyBinarySearch(int array[], int begin, int end, const int value) { while (begin array[... 阅读全文

posted @ 2016-11-24 15:20 itdef 阅读(384) 评论(0) 推荐(0)

堆排序练习
摘要:#include using namespace std; int arr[] = {1,2,3,4,5,6 }; void swap(int& i, int& j) { int k = i; i = j; j = k; } void HeapAdjust(int array[], int i,const int length) { int lChild = i * 2; i... 阅读全文

posted @ 2016-11-24 11:33 itdef 阅读(269) 评论(0) 推荐(0)

根据输入偏移 旋转字符串
摘要:要求 根据输入的字符串和偏移进行旋转 比如输入 "abcdefg" 0 获得"abcdefg" 输入"abcdefg" 2 获得fgabcde #include <string>#include <iostream> using namespace std; string Reverse(strin 阅读全文

posted @ 2016-11-22 15:34 itdef 阅读(228) 评论(0) 推荐(0)

打印任意字符串排列组合
摘要:#include <iostream>#include <string> using namespace std; void swap(string& s,int i,int j){ char a = s[i]; s[i] = s[j]; s[j] = a;} void myPrint(string 阅读全文

posted @ 2016-11-21 16:32 itdef 阅读(428) 评论(0) 推荐(0)

逆转二叉树
摘要:逆转二叉树 代码练手 输出: 4 2 1 3 7 6 94 7 9 6 2 3 1 阅读全文

posted @ 2016-11-20 16:02 itdef 阅读(381) 评论(0) 推荐(0)

导航