自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 访问公有基类的成员

【代码】访问公有基类的成员。

2023-02-09 15:07:18 189

原创 重载流插入运算符 “<<”

【代码】重载流插入运算符 “

2023-02-07 16:41:25 188

原创 重载单目运算符

【代码】重载单目运算符。

2023-02-05 17:24:08 182

原创 友元运算符重载函数

【代码】友元运算符重载函数。

2023-02-05 16:31:28 146

原创 对运算符重载的方法

【代码】对运算符重载的方法。

2023-02-05 16:22:23 73

原创 不使用运算符重载来的复数相加

【代码】不使用运算符重载来的复数相加。

2023-02-05 16:15:01 93

原创 c++友元成员函数

介绍有关友元函数的简单应用外,还将用到类的提前引用声明。

2023-02-04 17:31:07 120

原创 C++ 讲普通函数声明为友元函数

友元函数的简单例子

2023-02-04 17:12:55 123

原创 c++引用注意事项

#include<iostream> using namespace std;//引用函数不能返回局部变量,否则使用一次后内存会删除//引用可以变成左值用来使用int& func(){ static int a = 20; return a;}void main(){ int& ref = func(); cout << ref << endl; func() = 100; cout << ref <&l.

2021-08-19 16:37:31 189

原创 c++new的使用

#include<iostream> using namespace std;//new返回的是 该类型数据的指针//在堆区创建整形的数据//释放内存用 deleteint* func(){ //int* P = new int(10); //return P; int *arr=new int[10]; for (int i = 0; i < 10; i++) { arr[i] = i; } for (int i = 0; i < 10; i++.

2021-08-19 16:18:42 91

原创 顺序查找和折半查找

#include<stdio.h>#define MAXSIZE 30typedef struct{ int key; char data;//其他数据类型 比如权值 }SeqList;int SeqSearch(SeqList r[], int n, int k){ int i = n; r[0].key = k;//哨兵 while (r[i].key!=k) { i--; } return i;}int BinSearch(SeqList r[], i.

2021-08-12 11:00:00 156

原创 DFS搜索树

#include<stdio.h>#include<stdlib.h>#define MAXSIZE 20typedef struct node{ int adjvex;//邻接点域 struct node* next;}EdgeNode;typedef struct vnode{ int vertax;//顶点域 EdgeNode* firstedge;}VertaxNode;void CreatAdjlist(VertaxNode g[], int .

2021-08-12 10:27:11 206

原创 建立无向图的邻接矩阵

#include<stdio.h>#include<stdlib.h>#define MAXSIZE 20typedef struct{ int vertax[MAXSIZE]; int edges[MAXSIZE][MAXSIZE];}MGraph;void CreatMGraph(MGraph* g, int e, int n)//建立邻接矩阵 n为顶点数,e为边数{ int i, j, k; printf("input data of vertaxs\n.

2021-08-12 09:35:48 2074

原创 中序线索化二叉树

#include<stdio.h>#include<stdlib.h> typedef struct node{ char data; int ltag, rtag; struct node* lchild; struct node* rchild;}TBTree;TBTree* pre;void Thread(TBTree* p)//对二叉树进行中序线索化{ if (p!=NULL) { Thread(p->lchild); if (p-&.

2021-08-11 21:23:57 129

原创 二叉树遍历的应用(求叶结点的数量和树的深度)

#include<stdio.h> #include<stdlib.h>#include <iostream>using namespace std;#define MAXSIZE 10typedef struct node{ char data; struct node* lchild, * rchild;}BSTree;void Preorder(BSTree* p){ if (p != NULL) { cout << p-.

2021-08-11 18:40:51 160

原创 二叉树的层次遍历

#include<stdio.h> #include<stdlib.h>#include <iostream>using namespace std;#define MAXSIZE 10typedef struct node{ char data; struct node* lchild, * rchild;}BSTree;typedef struct{ BSTree* data[MAXSIZE]; int rear, front;}SeQu.

2021-08-11 18:04:35 88

原创 两种非递归遍历二叉树方法

void Postorder(BSTree* p)//后序遍历{ BSTree* stack[MAXSIZE]; int i = 0,b[MAXSIZE]; stack[0] = NULL; while (p != NULL || i > 0) { if (p!=NULL) { stack[++i] = p; b[i] = 0; p = p->lchild; } else { p = stack[i--]; if (!b[i+1]).

2021-08-11 17:32:13 77

原创 二叉树的非递归遍历

#include<stdio.h>#include<stdlib.h>#define MAXSIZE 30typedef struct node{ char data; struct node* lchild, * rchild;}BSTree;void Preorder(BSTree* p)//先序遍历{ BSTree* stack[MAXSIZE]; int i = 0; stack[0] = NULL; while (p!=NULL||i>0).

2021-08-11 17:21:12 84

原创 算法:使用栈将队列逆置

#include <stdio.h> #include<stdlib.h>#define MAXSIZE 20typedef struct{ char data[MAXSIZE]; int top;}SeStack;void Init_Stack(SeStack **s){ *s = (SeStack *)malloc(sizeof(SeStack)); (*s)->top = -1;}int Empty_Stack(SeStack *s){ i.

2021-08-10 16:46:52 631

原创 顺序表的基本操作

#include<stdio.h>#include<stdlib.h>#define MAXSIZE 20typedef struct{ int data[MAXSIZE]; int len;}SeqList;SeqList *Init_SeqList()//顺序表的初始化{ SeqList *L; L = (SeqList *)malloc(sizeof(SeqList)); L->len = 0; return L;}void Creat.

2021-08-10 16:12:16 113

原创 链队列的基本操作

#include <stdio.h> #include<stdlib.h>typedef struct node{ char data; struct node *next;}QNode;typedef struct{ QNode *front, *rear;}LQueue;void Init_LQueue(LQueue **q){ QNode *p; *q = (LQueue*)malloc(sizeof(LQueue)); p = (QNode*.

2021-08-10 16:08:14 356 1

原创 pacharm专业版破解1秒完成

需要的留言我给你发破解包

2021-07-19 11:58:53 259 2

原创 python——turtle 实现樱花树

使用python中的turtle画一个很好看的樱花树,调用random和math话不多说,直接代码from turtle import *from random import *from math import *def tree(n,l): pd()#下笔 #阴影效果 t = cos(radians(heading()+45))/8+0.25 pencolor(t,t,t) pensize(n/3) forward(l)#画树枝

2021-07-10 18:10:49 1605 2

原创 python简易爬虫利用百度翻译制作自己的小翻译

本人作为刚学习几天的python 对爬虫非常的感兴趣 想用爬虫做一个翻译小东西,超级简单如果大家对爬虫也感兴趣,希望大家关注我,我会分享自己学习的爬虫过程,话不多说 直接上代码发现呢 百度翻译地址 采取的是一个动态的页面,我们叫需要找到地址的真实地址我们在百度翻译的网址:https://fanyi.baidu.com/?aldtype=16047#en/zh/当我们在聊天框输入想要查询的东西是呢,网址会给我们自动的跳出最后的结果,比如我们不需要点击上面,百度翻译页面会自己动的变化,.

2021-07-10 17:56:30 436

空空如也

空空如也

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

TA关注的人

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