摘要:#pragma once#include "MyLink.h" template<typename T>class MyStack { MyLink<T> lk; MyStack& operator=(const MyStack&); MyStack(const MyStack&);public:
阅读全文
摘要:// StlTest1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include using namespace std; template class print { public: void operator()(const T& elem) { cout iv(ia, ia+6); ...
阅读全文
摘要:def 程序员 原文 https://www.zhihu.com/question/54350343 陈硕 等 54 人赞同了该回答 def 程序员 原文 https://www.zhihu.com/question/54350343 陈硕 等 54 人赞同了该回答 def 程序员 原文 https
阅读全文
摘要:随手写个解析INI配置字符串的小例子 带测试 测试头文件
阅读全文
摘要:算法导论 第18章 B树与其他树的结构不同的是 B数是多叉而不是二叉树 而且分叉因子很大一般使用于数据库 针对需要硬盘IO的情况而使用 可以降低磁盘IOB树的一个节点是以磁盘的页面为单位,而不是数据内容为单位 一般一个节点等于一个完整的磁盘页以下B树性质是本人理解 具体定义可查阅算法导论18章节除了
阅读全文
摘要:网络编程学习 注意的指标MB/S 带宽每秒处理的信息 查询等 messages/s queries/s transaction/s延时cpu使用率 ttcp测试网络 读写读写 循环 测试网络带宽 正确关闭TCP shutdown_write read->0 closesocket TCP_NODEL
阅读全文
摘要:win32-msvc2015: { contains(QMAKE_HOST.arch, x86):{ INCLUDEPATH += D:\3SDK\boost_1_61_0 LIBS += -LD:\3SDK\boost_1_61_0\stage32\lib } contains(QMAKE_HOS
阅读全文
摘要:将四则运算拆分成一个个数字和符号后 就进行运算分析 使用以下语法规则:(摘录自《自编编程语言》) expression: term: primary expression: 代码如下: 测试代码如下: type: 1, string: 1type: 2, string: +type: 1, stri
阅读全文
摘要:#include <string>#include <iostream>using namespace std; char* testStr = "12+345-6*8/9"; typedef enum { BAD_TOKEN, NUMBER_TOKEN, ADD_OPERATOR_TOKEN, S
阅读全文
摘要:学习实践垃圾回收的一个小代码 采用引用计数 每次多一个指针指向这个分配内存的地址时候 则引用计数加1 当计数为0 则释放内存 他的难点在于指针之间的复制 所有权交换 计数的变化 #include <vector>#include <iostream> using namespace std; tem
阅读全文
摘要:题目来自<系统程序员成长计划> 作者:李先静. 状态变化如下 运行结果 group = GRPkey = name. value = defkey = data. value = 2016.11.29comment = this is a commentkey = str. value = this
阅读全文
摘要:#include <memory> #include <iostream>#include <chrono>#include <thread>using namespace std; struct ListNode { int val; shared_ptr<ListNode> next;}; bo
阅读全文
摘要:#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...
阅读全文
摘要:#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)...
阅读全文
摘要:来自 从零开始的 JSON 库教程 从零开始教授如何写一个符合标准的 C 语言 JSON 库 作者 Milo Yip https://zhuanlan.zhihu.com/json-tutorial 根据第一课教程 自己重新编写 做了一点修改 加深学习印象 测试效果 12/12 (100%) pas
阅读全文
摘要:题目来自<系统程序员成长计划> 作者:李先静. 逐个字符扫描 根据是否为字母决定当前状态 由单词内状态切换到单词外 计数字符加1 改进版 计数以外还讲单词放入容器 运行结果 1919this s a test Hello World Welcome to the real world it suck
阅读全文
摘要:#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[...
阅读全文
摘要:#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...
阅读全文
摘要:要求 根据输入的字符串和偏移进行旋转 比如输入 "abcdefg" 0 获得"abcdefg" 输入"abcdefg" 2 获得fgabcde #include <string>#include <iostream> using namespace std; string Reverse(strin
阅读全文
摘要:#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
阅读全文