自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(112)
  • 收藏
  • 关注

原创 新的语言新的方向,未来到底指向何方?

C语言的创始时间是1972年因其优秀的特质(快),在2020年的今天仍然在语言的前几名,新出的语言花样繁多,到底什么样的方向才是我们追求的目的,更快更正确更稳定,现在衡量算法的好坏,我觉得还得再加上新的要求,更好的支持多核处理。...

2020-10-29 14:45:55 178

原创 文件复制(Go语言实现)

在这里插package mainimport ( "fmt" "io" "os" "strconv" "time")type MyCopy struct{}func NewMyCopy() *MyCopy { return new(MyCopy)}//保存上次文件读取到的位置var last string = "./last"/*** 功能:文件复制(支持断点续传)* Seek(offset int64, whence int) (ret int64, err er

2020-10-05 21:53:56 703

原创 Go语言认知

Go语言——面向一线开发的语言go语言,最近有时间进行较为深度的学习,在了解go语言的过程中,(我是在官网看文档的),go语言有很多小细节,针对一线开发中的麻烦点,进行简化,为一线开发人员大开方便之门。...

2020-09-19 16:05:18 150

原创 2020-9-16实习工作小结

从公司到学校考试2周后,又来到深圳打工,在深圳一家做人工智能的公司做后台开发实习生,这段时间,我的产品经理没有需求,在对代码了解过后,对测试环境进行了解,每天都在等待新的bug,并协助调查引起错误的原因,在学校都是通过调试来进行排查,在公司这种项目上出现的问题,都是通过日志进行查验。...

2020-09-16 17:04:00 136

原创 工作日记(第一周)

在昨天结束一周的工作后,做了串讲,忙活了一周去做准备,走错了路,又和提出问题的人进行商量,进行目标转移,进行更进一步的操作。学习如何学习,嗯解释一下,学习如何更有效地学习,从目的出发,拿到需要的资料,进行针对性阅读。事情就很快的完成了,找到合适的路,很快就会抵达终点....

2020-08-19 17:43:26 121

原创 归并排序

#include <iostream>#include <vector>using namespace std;void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(it;it != vec.end();it++) { cout<<*it<<" "; } c

2020-08-04 23:38:09 109

原创 堆排序

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(i

2020-08-04 23:37:25 105

原创 基数排序

#include <iostream>#include <vector>#include <queue>using namespace std;void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(it;it != vec.end();it++) { cout<<*it&lt

2020-08-04 23:36:39 98

原创 快排

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(

2020-07-27 23:11:02 92

原创 希尔排序

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(

2020-07-27 23:09:15 89

原创 直接插入排序

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(

2020-07-27 23:06:39 92

原创 选择排序

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(

2020-07-27 23:04:12 72

原创 冒泡排序

#include <iostream>#include <vector>using namespace std;void Swap(int &a,int &b){ int tmp = a; a = b; b = tmp;}void Show(vector<int> & vec){ vector<int> :: iterator it = vec.begin(); for(

2020-07-27 23:02:09 78

原创 打家劫舍(三光)

没啥好说的,嗯,就是那个啥动态规划,对就是动态规划。class Solution {public: int rob(vector<int>& nums) { int n = nums.size(); vector<int> dp(n); dp[0] = nums[0]; dp[1] = max(nums[0],nums[1]); for(int i = 2;i < n;++i)

2020-07-23 22:13:44 111

原创 二叉树的中序遍历(递归和非递归)

非递归:在这class Solution {public: vector<int> inorderTraversal(TreeNode* root) { vector<int> vec; stack <TreeNode*> sta; TreeNode* ptr = root; while(NULL != ptr || !sta.empty()) {

2020-07-23 21:14:25 96

原创 不同的二叉搜索树

好吧我是懒狗,看到这个题,第一反应就是,递归去做,这个题也没给时间限制,我就试了一下递归。int numTrees(int n){ int sum = 0; if(n == 1 || n == 0) { return 1; } for(int i = 1;i <= n;++i) { sum +=numTrees(i-1) * numTrees(n - i); } return sum;}大概就

2020-07-22 23:11:44 124

原创 力扣——两数之和(简单)

#include<iostream>using namespace std;void Sum(int *nums,int target,int len,int &f1,int &f2){ if(NULL == nums)return ; for(int i = 0;i < len;++i) { for(int j = i+1;j < len;++j) { if(nums[i.

2020-07-21 22:26:41 447

原创 工厂模式

简单工厂模式:#include<iostream>using namespace std;class Fruits{public: Fruits(const string &name) :nname(name){} virtual void Show() = 0;private: string nname;};class Apple: public Fruits{public: Apple(const st

2020-07-20 22:09:18 97

原创 不能被继承的类

#include<iostream>/*通过友缘和虚继承实现。在继承层次中,先构造虚基类,可是虚基类A,只能由B来进行构造,也就是说B这个类不能被继承注意B的声明必须放到A的前面。*/using namespace std;class B;class A{private: A() {}; friend class B;};class B : virtual public A{public: B():A() {}};

2020-07-20 22:05:20 169

原创 单例模式

饿汉模式/*#include<iostream>using namespace std;class Test {public: static Test* Getinstance()//只能以指针返回,其他不行。static调用约定不是thiscall { return m_instance; }private: Test()//将构造和拷贝构造写在私有下 {}; Test(const Test & r

2020-07-16 22:05:29 81

原创 最短路径——Floyd算法

#include<iostream>using namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int INFINITY = 65535;typedef int Pathmatirx[MAXVEX][MAXVEX];typedef int ShortPathTable[MAXVEX][MAXVEX];typedef str

2020-07-14 09:22:31 123

原创 BST——C++

BST树,是指左子树上所有节点都小于双亲结点,右子树上所有节点都大于双亲结点的二叉树,BST树又称为二叉排序树和二叉搜索树,理想状态下真的很不错,如果不是频繁的对树进行增删其实哈、还好,嘻嘻,就怕你改成了斜树,那样就是废品。怎么说呢,这些搜索树,都是为了模仿二分查找的,好好学习吧少年。#include<iostream>/*BST的类写好了,增删改查,emmm不难,但是发现书上给的代码有问题,大话数据结构324页,4-11行。错的离谱,感觉就像开玩笑,可能是我看错了,我没按照书上写。

2020-07-13 23:22:29 480

原创 与这个美丽的世界说再见的atoi——使用字符串来判断是否溢出

/*题目1:(简答题:10.0分)编程实现将字符串转换为整型数;int my_atoi(const char *str);1.遇到非数字字母,停止转换;示例: str = “234.324” ; 返回值是234;2.首先出现空格的字符串可以转换,转换开始后,遇到空格停止转换;示例: str =" 342 456"; 返回值是342;3.可以处理正负号;示例: str = " +234.bad" ; 返回值是 234; str = " -342ab.234" ; 返回值是:

2020-07-06 00:48:53 306 1

原创 点分十进制表示的字符串转换为 unsigned int 整型数值

/*题目4:(简答题:10.0分)实现函数将点分十进制表示的字符串转换为 unsigned int 整型数值unsigned int my_ResDotDec(const char *strip);参数说明:strip 点分十进制表示的字符串;示例: strip =“128.11.3.31” ; 返回值: 2148205343;strip =“128.399.2.12” ; 返回值为 UINT_MAX#include <iostream>#include <ctype.h&

2020-07-03 19:12:24 929

原创 无符号整型转点分十进制

/*题目3:(简答题:10.0分)实现函数将 unsigned int 整型数值转为点分十进制记法表示:点分十进制(Dotted Decimal Notation)全称为点分(点式)十进制表示法,是IPv4的IP地址标识方法。IPv4中用四个字节表示一个IP地址,每个字节按照十进制表示为0~255。点分十进制就是用4个从0~255的数字,来表示一个IP地址。char * my_DotDec(unsigned int ip,char *buffer);参数说明:value:欲转换的数数值。b

2020-07-03 11:52:28 1510

原创 My——itoa

/*题目2:(简答题:10.0分)编程实现将整型数值转换为字符串。char *my_itoa(int value, char *buffer, int radix);参数说明:value:欲转换的数值。buffer:目标字符串的地址。radix:转换后的进制数,可以是2进制,10进制、16进制等。示例: value = 10; radix = 2; string=“1010”不考虑value 为负数。与函数int sprintf(char *string, char *format ,…

2020-07-03 08:55:31 176

原创 My——atoi(进制,空格,符号,溢出等处理),最全最细,有问题请问我

/*题目1:(简答题:10.0分)编程实现将字符串转换为整型数;int my_atoi(const char *str);1.遇到非数字字母,停止转换;示例: str = “234.324” ; 返回值是234;2.首先出现空格的字符串可以转换,转换开始后,遇到空格停止转换;示例: str =" 342 456"; 返回值是342;3.可以处理正负号;示例: str = " +234.bad" ; 返回值是 234; str = " -342ab.234" ; 返回值是:

2020-07-02 23:32:32 558

原创 最短路径(Dijkstra)

#include<iostream>using namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int INFINITY = 65535;typedef int Patharc[MAXVEX];typedef int shortPathTable[MAXVEX];typedef struct{ VertexT

2020-07-01 10:26:38 152

原创 最小生成树(kruskal算法)

#include<iostream>using namespace std;//kruskal算法中对边集数组要求必须是根据全职升序排序的typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int MAXEDGE = 100;typedef struct Edge{ int begin ,end; EdgeType weight

2020-06-30 14:46:37 132

原创 最小生成树(Prim)

#include<iostream>using namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int INFINITY = 65535;typedef struct{ VertexType vexs[MAXVEX]; EdgeType arc[MAXVEX][MAXVEX]; int numV

2020-06-30 11:58:03 3473 5

原创 超级详细的python爬虫提高CSDN页面访问量,学不会,我吃奥利给

首先你要有能够运行python3.0的运行环境,其次还要有这些三方库:其他就不需要了,本人自学4天就写出来了,相信你也可以我本来想发源代码,想了想还是发图片吧,需要源码可以私聊我如果你要用的话,只需要改两个地方就好了:拿我的博客举个例子,把红色的部分放到baseurl中,把绿色的数字放到arr列表中,你可以多放几个博客的数字,然后点击运行就好了。...

2020-06-28 15:50:55 538 5

原创 图——DFS,BFS(邻接表)

DFS你可以当成树的先根遍历来做,BFS你可以当做树的层次遍历来做,这里因为图不一定是连通图,所以每个顶点都要尝试一下,用一个BOOL数组来表示这个顶点是否经历过遍历。#include<iostream>#include<queue>using namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;typedef struct Edg

2020-06-27 11:09:27 849

原创 图——DFS,BFS(邻接矩阵)

DFS你可以当成树的先根遍历来做,BFS你可以当做树的层次遍历来做,这里因为图不一定是连通图,所以每个顶点都要尝试一下,用一个BOOL数组来表示这个顶点是否经历过遍历。(这个编辑器插入代码段为啥只能是黑色)#include<iostream>#include<queue>using namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;c

2020-06-27 10:32:57 795

原创 图——边集数组

#includeusing namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int MAXEDGE = 100;typedef struct Edges{int begin ,end;EdgeType weight;}Edges;typedef struct Graph//图{VertexType vexs[MAXVEX]

2020-06-23 17:01:47 1528

原创 图——邻接表

#includeusing namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;typedef struct EdgeNode//边表结点{int adjvex;EdgeType weight;EdgeNode * next;}EdgeNode;typedef struct VertexNode//顶点表结点{VertexType data;E

2020-06-23 16:33:49 206

原创 图——邻接矩阵

#includeusing namespace std;typedef char VertexType;typedef int EdgeType;const int MAXVEX = 100;const int INFINITY = 65535;typedef struct{VertexType vexs[MAXVEX];EdgeType arc[MAXVEX][MAXVEX];int numVertexes,numEdges;}MGraph;/*建立

2020-06-23 15:35:10 210

原创 线索化二叉树

我们把指向前驱或者后继的指针称为线索,加上线索的指针就称之为线索二叉树#includeusing namespace std;typedef char Elemtype;typedef enum{Link,Thread} PointTag;typedef struct BiTNode{Elemtype data;BiTNode *lchild,*rchild;PointTag LTag,RTag;}BiTNode,*BiTree;BiTNode * BuyBiTNode

2020-06-22 11:44:08 92

原创 二叉树的建立

#includeusing namespace std;typedef char Elemtype;typedef struct BiTNode{Elemtype data;BiTNode *lchild,*rchild;}BiTNode,*BiTree;BiTNode * BuyBiTNode(Elemtype val){BiTNode * s = new BiTNode();s->data = val;return s;}BiTree CreatBiTr

2020-06-21 11:15:31 621

原创 二叉树遍历

二叉树的遍历,是将树形结构线性化的过程。#include<iostream>#include<queue>using namespace std;typedef char Elemtype;typedef struct BiTNode{ Elemtype data; BiTNode *lchild,*rchild;}BiTNode,*BiTree;void PreOrderTraverse(BiTree T)//前序{ i

2020-06-21 10:08:31 195

原创 循环队列

#include const int MAXSIZE = 10;template class Myqueue{public:Myqueue(){data = new TMAXSIZE;real = front = 0;}~ Myqueue(){delete [] data;}bool Empty(){return real == front;}bool Full(){return (real + 1 + MAXSIZE) % MAXSIZE == front

2020-06-14 10:56:47 620

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除