随笔分类 - C++/C
1
摘要:服务端 /* * main.c * 测试udp Socket套接字 单任务服务端代码实现 * Created on: 2020年3月4日 * Author: LuYonglei */ #include <sys/socket.h> #include <arpa/inet.h> #include <u
阅读全文
摘要:typedef union bigSmallEnd{ unsigned short a; unsigned char b[2]; }BSE; void testBSE() { BSE test; test.a = 0x0102; if (test.b[0] == (unsigned char) 0x
阅读全文
摘要:/* * main.c * 子进程状态改变会发送SIGCHLD信号给父进程 * 此处实现父进程创建并回收多个子进程 * Created on: 2020年3月3日 * Author: LuYonglei */ #include <stdlib.h> #include <stdio.h> #inclu
阅读全文
摘要:非优化版本 /* * NQueens.h * * Created on: 2020年3月2日 * Author: LuYonglei */ #ifndef SRC_NQUEENS_H_ #define SRC_NQUEENS_H_ #include <iostream> using namespac
阅读全文
摘要:头文件 /* * MemoryManage.h * * Created on: 2020年2月22日 * Author: LuYonglei */ #ifndef SRC_MEMORYMANAGE_H_ #define SRC_MEMORYMANAGE_H_ #include <stdlib.h>
阅读全文
摘要:/* * UnionFind.h * 有两种实现方式,QuickFind和QuickUnion * QuickFind: * 查找O(1) * 合并O(n) * QuickUnion:(建议使用) * 查找O(logn)可优化至O(a(n)),a(n)<5 * 合并O(logn)可优化至O(a(n)
阅读全文
摘要:/* * UnionFind.h * 有两种实现方式,QuickFind和QuickUnion * QuickFind: * 查找O(1) * 合并O(n) * QuickUnion:(建议使用) * 查找O(logn)可优化至O(a(n)),a(n)<5 * 合并O(logn)可优化至O(a(n)
阅读全文
摘要:/* * UnionFind.h * 有两种实现方式,QuickFind和QuickUnion * QuickFind: * 查找O(1) * 合并O(n) * QuickUnion:(建议使用) * 查找O(logn)可优化至O(a(n)),a(n)<5 * 合并O(logn)可优化至O(a(n)
阅读全文
摘要:冒泡排序 /* * BubbleSort.h * 冒泡排序 * Created on: 2020年2月10日 * Author: LuYonglei */ #ifndef SRC_BUBBLESORT_H_ #define SRC_BUBBLESORT_H_ #include <vector> us
阅读全文
摘要:/* * QuickSort.h * 快速排序(将每一个元素转换为轴点元素) * Created on: 2020年2月12日 * Author: LuYonglei */ #ifndef SRC_QUICKSORT_H_ #define SRC_QUICKSORT_H_ #include <vec
阅读全文
摘要:/* * HeapSort.h * 堆排序 * Created on: 2020年2月10日 * Author: LuYonglei */ #ifndef SRC_HEAPSORT_H_ #define SRC_HEAPSORT_H_ #include <vector> using namespac
阅读全文
摘要:/* * MergeSort.h * 归并排序 * Created on: 2020年2月12日 * Author: LuYonglei */ #ifndef SRC_MERGESORT_H_ #define SRC_MERGESORT_H_ #include <vector> using name
阅读全文
摘要:BinaryHeap源码实现 /* * BinaryHeap.h * 二叉堆(完全二叉堆) * Created on: 2020年2月3日 * Author: LuYonglei */ #ifndef SRC_BINARYHEAP_H_ #define SRC_BINARYHEAP_H_ #incl
阅读全文
摘要:AVLTree源码实现 /* * BinarySearchTree.h * 1. 添加元素时需自己做判断元素是否合法 * 3. 本代码实现的AVL树没有统一旋转操作,采用分情况讨论LL,LR,RR,RL来进行树的平衡 * Created on: 2020年1月29日 * Author: LuYong
阅读全文
摘要:RBTree源码实现
/*
* BinarySearchTree.h
* 添加元素时需自己做判断元素是否合法
* Created on: 2020年1月29日
* Author: LuYonglei
*/
阅读全文
摘要:/*
* BinarySearchTree.h
* 添加元素时需自己做判断元素是否合法
* Created on: 2020年1月29日
* Author: LuYonglei
*/
#ifndef SRC_BINARYSEARCHTREE_H_
#define SRC_BINARYSEARCHTREE_H_
#include
阅读全文
摘要:/*
* BinarySearchTree.h
* 1. 添加元素时需自己做判断元素是否合法
* 2. 除层序遍历外,本源代码均采用递归遍历,若要减少栈的消耗,应该实现迭代遍历
* 3. 本代码实现的AVL树有统一旋转操作,不用分情况讨论LL,LR,RR,RL来进行树的平衡
* 统一旋转操作有特殊优化版本和统一接口版本,本代码保留了统一接口的源码,但是采用的是特殊优化版本
* Created on: 2020年1月29日
* Author: LuYonglei
*/
阅读全文
摘要:/*
* BinarySearchTree.h
* 1. 添加元素时需自己做判断元素是否合法
* 2. 除层序遍历外,本源代码均采用递归遍历,若要减少栈的消耗,应该实现迭代遍历
* 3. 本代码实现的AVL树没有统一旋转操作,采用分情况讨论LL,LR,RR,RL来进行树的平衡
* Created on: 2020年1月29日
* Author: LuYonglei
*/
阅读全文
摘要:eclipse CDT 2019-06代码补全插件 本自动补全文件已在2019-06至2019-09平台上做过测试,均已完美通过功能检测 在原来Eclipse工具补全的基础上新增26个英文字符和"_"的补全 制作顺序如下: 修改verifyAutoActivation函数,包路径如下: 函数修改之后
阅读全文
摘要:NetBeans早期版本提供修改提示速度的选项,大概是6.5版本之后就没这个修改功能了,但是仍可以配置: Windows配置如下: 1、C:\Users\${用户名}\AppData\Roaming\NetBeans\${版本号}\config\Editors\text目录下; 2、打开对应的目录,
阅读全文
1

浙公网安备 33010602011771号