摘要: 1.【精校中英字幕】2015 CMU 15 213 CSAPP 深入理解计算机系统 课程视频 https://www.bilibili.com/video/av31289365?p=2 2. 韩立刚老师主讲 计算机网络第5版谢希仁编写 全集156集 https://www.bilibili.com/ 阅读全文
posted @ 2019-10-10 22:46 一路一沙 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 方法一: windows下调用icmp.dll库,实现ping连通检测,缺点是不能跨平台,受限于icmp.dll库: 方法二: 使用原始套接字,模拟实现ping程序以进行网络连通检测,可跨平台,缺点是在linux下使用原始套接字必须拥有超级用户权限: 方法三: 使用非阻塞connect函数和sele 阅读全文
posted @ 2019-04-04 14:09 一路一沙 阅读(1255) 评论(0) 推荐(0) 编辑
摘要: 0. 序 本以为用最小堆实现个哈夫曼树是个简单的事情,结果一不小心就花了好几个小时才写完。。。实现过程中主要有三个方面的问题没注意,导致花了很多时间进行调试。 一是多重指针malloc分配时要多加注意; 二是指针一定要记得初始化,默认不一定为NULL; 三是结构体赋值问题。 其余的边界问题小心就好了 阅读全文
posted @ 2018-07-19 13:16 一路一沙 阅读(2356) 评论(2) 推荐(0) 编辑
摘要: 1. 最小堆结构定义如下: 2. 最小堆的基本操作函数如下: MinHeap createMinHeap(int capacity); // 创建最小堆 bool isFull(MinHeap minHeap); // 判断最小堆是否已满) bool isEmpty(MinHeap minHeap) 阅读全文
posted @ 2018-07-18 16:54 一路一沙 阅读(966) 评论(0) 推荐(0) 编辑
摘要: 1. 二叉搜索树结点结构定义如下: 2. 二叉搜索树的基本操作函数如下: void preOrderTraverse(TreeNode head); // 先序遍历(递归) TreeNode searchBST(TreeNode head, int val); // 查找操作(尾递归) TreeNo 阅读全文
posted @ 2018-07-16 21:59 一路一沙 阅读(583) 评论(0) 推荐(0) 编辑
摘要: C++示例程序: class Solution { public: vector twoSum(vector& nums, int target) { int length = nums.size(); vector result; unordered_map um; for (int i = 0; 阅读全文
posted @ 2018-07-07 21:38 一路一沙 阅读(134) 评论(0) 推荐(0) 编辑
摘要: C++示例程序: class Solution { public: void moveZeroes(vector& nums) { int number = 0; int length = nums.size(); for(int i = 0; i 阅读全文
posted @ 2018-07-07 21:37 一路一沙 阅读(113) 评论(0) 推荐(0) 编辑
摘要: C++示例程序: class Solution { public: vector intersect(vector& nums1, vector& nums2) { vector result; unordered_map um; for (int i = 0; i 阅读全文
posted @ 2018-07-07 21:35 一路一沙 阅读(147) 评论(0) 推荐(0) 编辑
摘要: C++示例程序: class Solution { public: int singleNumber(vector& nums) { int length = nums.size(); if (length == 0 || length == 2) return 0; for (int i = 0; 阅读全文
posted @ 2018-07-07 21:34 一路一沙 阅读(111) 评论(0) 推荐(0) 编辑
摘要: C++示例程序: class Solution { public: bool containsDuplicate(vector& nums) { unordered_map um; for (int i = 0; i 阅读全文
posted @ 2018-07-07 21:33 一路一沙 阅读(112) 评论(0) 推荐(0) 编辑