自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

IronCarrot's Blog

为了证明我没有那么懒,所以我写下了这段描述

  • 博客(151)
  • 问答 (2)
  • 收藏
  • 关注

原创 About My Blog

开这个博客,记录一些学习的过程和体会。感谢阅读。

2018-02-07 22:50:39 1081 1

原创 【PHP】安装完PHPStudy以后打开phpMyAdmin显示404

首先是因为Mysql没有设置密码,现在进入PHPStudy→其他选项菜单→MySQL工具,第一个就是设置或修改密码,初始密码是root,然后修改密码。这个时候还是打不开phpMyAdmin,原因是网站根目录下没有phpMyAdmin这个文件夹或者误删了这个文件夹。从官网上下载安装phpMyAdmin,传送门:https://www.phpmyadmin.net/downloads/我下

2018-01-26 00:00:34 16723 3

原创 【Python】解决Python27下安装requests问题

重装Python27的时候使用requests库就一直报错显示不存在这个库,但是使用pip安装的时候一直在报下面的错,这次终于解决这个问题了。报错信息::'ascii' codec can't encode characters in position 9-14解决办法,安装失败的时候会有一个报错的信息:解决办法就是在这个文件下添加:修改以后保存就能成功。

2018-01-25 14:56:10 1198

原创 【Python】Python多线程爬虫学习(1)

相关模块:thread 相关函数:start_new_thread(调用的函数,函数里的参数)例1:thread下的多线程简单示例#coding=utf-82018.1.8\import threadimport timedef fun1(): print "Hello World %s"%time.ctime()def main(): thread.sta

2018-01-12 19:13:14 447

原创 【CTF-Crypto】PlayFair密码

PlayFair密码是古典密码的一种,由一个5*5的矩阵构成密钥;为了方便描述,加密与解密的过程,这里引用一道实验吧的题目;http://www.shiyanbar.com/ctf/1852给出的密文是:The quick brown fox jumps over the lazy dog!按照把这句话去掉空格按5*5写成一个矩阵的形式,i,j不单独分开,两个字母相等;

2017-09-07 20:16:52 1534

原创 【并查集】OJ_0003 A Bug

题目链接#include int num, f[10005]; void init(int x){    int i;    for (i = 1; i <= x; i++)        f[i] = i;} int getf(int v){    if (f[v] == v) return v;    else    {        f[v] = g

2017-07-26 15:33:59 423

原创 【C++】简述基类和派生类中数据成员间的关系

首先,在进行一个工程构建的时候,不能为了方便而把所有基类数据成员设置为公有。在调用过程中,基类中私有类型的数据成员不能在派生类中直接调用,需要用到一个get()形式的访问函数才能在子类中访问对应的基类数据成员。class Coordinate{ public: int getx(); private: int x; };int Coordinate::getx(){

2017-06-07 11:20:24 1650

原创 【swust.oj_1066】有向图的邻接矩阵存储强连通判断

假设有向图G采用邻接矩阵存储,设计一个算法,判断图G是否是强连通图。若是则返回yes;否则返回no。 第一行为一个整数表示顶点的个数。接下来是为一个整数矩阵,表示图的邻接关系。 yes(强连通图)或no(非强连通图).。50 1 0 0 00 0 1 1 00 0 0 1 01 0 0 0 11 0 0 0 0--------------

2017-05-18 13:07:29 3230 1

原创 【swust.oj_0415】Digital Roots

Digital RootsThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting

2017-05-18 12:43:12 368

原创 【数据结构_BFS_1069】图的深度优先录入

#include #include #include #include using namespace std;int n,maps[105][105],vis[1005]={0};char str[1005];queueq;void bfs(int tar){ cout<<q.front(); vis[tar]=1; for(int i=0;i<n;i++) { i

2017-05-14 09:23:26 429

原创 【数据结构_1015_堆排序】一趟堆排序后的结果

#include #include #include using namespace std;int n;void dui(int k,int a[]){ int i=k,j=i*2; int item=a[i]; while(j<=n) { if(ja[j+1]) { j++; } if(item>a[j]) { a[i]=a[j]; i

2017-05-13 19:47:13 5468

原创 【数据结构_哈希表_1012+1013】哈希表相关

2017.5.11补充:关于这个东西,如果直接交我的代码WA这锅我不背...本来已经是AC代码的后来不知道系统怎么了,我觉得是后台数据改了所以A不了。#include #include #include using namespace std;int main(){ int n,m; int a[1005]; int tar; cin>>n

2017-05-01 12:16:13 474

原创 【数据结构_折半查找_1010】折半查找的实现

折半查找必须是在一个有序数组里进行查找,每次查找一半,不符合则继续折半。#include #include #include #include using namespace std;int flag=0,cnt=0;int find(int a[],int tar,int num){ int low=0,high=num-1,mid; while(low<=hi

2017-04-20 10:38:52 1635

原创 【数据结构_图_DFS_1068】深度优先搜索

5HUEAK0 0 2 3 00 0 0 7 42 0 0 0 03 7 0 0 10 4 0 1 0H----------------------------HEAUK#include #include #include #include using namespace std;int maps[105][

2017-04-18 23:38:31 5553

原创 【数据结构_堆_1098】堆的判断

注意:1.进行循环读入数组时,从1开始;2.(i*2)和(i*2+1)均不得超过数组大小;#include #include #include using namespace std;int main(){ int n,a[1005],i,j,flag=0; cin>>n; for(i=1;i<=n;i++) cin>>a[i]; for(i=1;i<=n

2017-04-18 00:57:41 1207

原创 【数据结构_树_Tree_AVL_1077】平衡二叉树

参考资料:http://blog.csdn.net/u010442302/article/details/52713585#include #include #include #include using namespace std;typedef struct node{ char data; struct node *L_Child,*R_Child;}Tree;

2017-04-17 00:17:30 592

原创 【数据结构_图_DFS_1072】有向图邻接矩阵储存根的计算

DFS极简版,如果不理解递归,可以在草稿纸上写一下运行过程;递归参考资料:http://blog.csdn.net/speedme/article/details/21654357之前一直在错,原因是我考虑用cnt来计数,然后cnt计数会出现重复然后就一直错。#include #include #include using namespace std;int n,maps[10

2017-04-16 15:28:38 1034

原创 【数据结构_树_Tree_1105】交换二叉树的孩子结点

参考资料来源: 交换二叉树孩子结点#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;void initTree(Tree *&T){ char str; cin>>st

2017-04-01 18:48:29 1697

原创 【数据结构_图_1065】无向图连通分量计算

无向图连通分量#include #include #include using namespace std;int maps[105][105];int flag[1005]={0},n;void dfs(int x,int y){ int i; for(i=0;i<n;i++) { if(flag[i]==0 && maps[y][i]>0) {

2017-04-01 18:18:45 2967

原创 【数据结构_树_Tree_1053】先序创建输出结点的度

Simple.#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;int cnt=0;void initTree(Tree *&T){ char str; cin>>str; if(str!='#'

2017-04-01 16:10:15 590

原创 【数据结构_树_Tree_1052】先序输入后输出指定父节点

#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;Tree *temp;void initTree(Tree *&T){ char str; cin>>str; if(str!='#') { T

2017-04-01 16:01:54 408

原创 【数据结构_树_Tree_1051】先序创建然后输出指定结点

被自己蠢哭了...#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;void initTree(Tree *&T){ char str; cin>>str; if(str!='#') {

2017-04-01 15:13:18 430

原创 【数据结构_邻接图_1056】邻接表到邻接矩阵

#include #include #include using namespace std;int main(){ int n; int maps[205][205]; int i,j; cin>>n; getchar(); for(i=0;i<n;i++) for(j=0;j<n;j++) maps[i][j]=0; for(i=0;i<n;i++) {

2017-03-30 13:28:49 1781 1

原创 【数据结构_树_Haffman_0986】Huffman Code

#include #include #include using namespace std; const int maxvalue=100; const int maxbit=100; const int maxn=100; struct haffnode { char ch; //节点值 int weight; //权重 int flag; //确定当前点有没有放入

2017-03-29 19:31:57 494

原创 【数据结构_冒泡排序_1014】冒泡排序

好久没有写过这么简单的代码了笑死,只用排一趟#include #include #include using namespace std;int main(){ int num,a[1005],i,j; while(cin>>num) { for(i=0;i<num;i++) cin>>a[i]; for(i=0;i<num;i++) { for(j=i+1;j<

2017-03-28 14:14:57 374

原创 【数据结构_插入排序算法_1016】插入排序算法实现

插入排序可以百度。具体可以参考:插入排序相关#include #include #include using namespace std;int main(){ int num,a[1005],i,j; cin>>num; for(i=0;i<num;i++) cin>>a[i]; for(i=1;i<num;i++)//要从第一个开始比较,所以把i置为0;

2017-03-28 13:54:28 614

原创 【数据结构_树_Tree_1011】二叉排序树的实践和查找

二叉排序树具体可以百度,亲测百度代码不错。讲一下解题步骤:1.创建第一个结点;2.利用递归,比结点小的放在L_Kid,比结点大的放在R_Kid;----------------------------------------------1225 18 46 2 53 39 32 4 74 67 60 1174---------------------

2017-03-28 00:01:46 1050

原创 【数据结构_树_Tree_0984】利用中序及先序确定后序

题目不难,理解了中序,先序,后序是怎么创建和遍历二叉树的就很简单;代码上我写了注解,便于理解。#include #include #include #include using namespace std;typedef struct node { char data; struct node *L_Kid,*R_Kid;}Tree;Tree *CreateTr

2017-03-27 17:51:21 405

原创 【数据结构_链表_List_1040】一元多项式加法运算的实现

#include #include #include #include using namespace std;typedef struct node{ int data1,data2;//data1表示系数,data2表示次方; struct node *next;}List;void initList(List *&L){ L=(List *)mall

2017-03-26 22:58:17 2103

原创 【数据结构_树_Tree_0983】利用二叉树中序和后序遍历确定二叉树的先序遍历

well,it took me two days to solve it.share some useful files here.点击打开链接→just open it.#include #include #include using namespace std;typedef struct node{ char data; struct node

2017-03-23 21:30:34 565

原创 【数据结构_树_Tree_0982】利用二叉树储存普通树的度

Problem:数据结构中树的度是什么?Answer:树内各结点的度的最大值.(结点拥有的子树数称为结点的度).链接:树和二叉树的相互转化链接:将树转化为二叉树的代码实践#include #include #include using namespace std;int maxn=0;typedef struct node{ char data; str

2017-03-20 20:40:23 2024 1

原创 【数据结构_树_Tree_0981】统计利用二叉树存储的森林中树的棵数

来点科普先,简单介绍一下怎么计算二叉树储存的森林中树的棵树:按照森林和二叉树的转换规则可得: 从二叉树根开始一直往右子树走,一共路过几个节点,对应的森林就有几个根,也就是说,对应的森林有几棵树 高度为h的满二叉树最右边一路有h个节点(就是高度为n),因此对应的森林有h棵树.所以很简单,利用先序遍历创建完树以后,直接利用右结点递归,找到右结点就cnt++;#include

2017-03-20 20:12:37 2328

原创 【数据结构_树_Tree_0980】用先序遍历创建树然后层次遍历输出

OMG,我之前没用,我用递归写的,样例过了就是wa,好气噢,然饿我还不知道哪里错了,下面这个是改良版AC代码;#include #include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;void

2017-03-20 19:41:31 631

原创 【数据结构_树_Tree_0979】先序读入后序输出

后序:左右根#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;void initTree(Tree *&T){ char str; cin>>str; if(str!='#') { T

2017-03-18 19:22:43 283

原创 【数据结构_树_Tree_0978】按先序输出树中的元素

#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;void initTree(Tree *&T){ char str; cin>>str; if(str!='#') { T=(Tree *)mal

2017-03-18 19:19:20 424

原创 【数据结构_树_Tree_0977】计算二叉树中空链域的个数

#include #include #include using namespace std;typedef struct node { char data; struct node *L_Kid,*R_Kid;}Tree;int cnt=0;void initTree(Tree *&T){ char str; cin>>str; if(str!='#') { T

2017-03-18 19:02:27 1874

原创 【数据结构_树_Tree_0976】利用二叉树统计度为1的结点

和统计2的那题一样,只改了一行代码;#include #include #include using namespace std;typedef struct node { char data; struct node *L_Kid,*R_Kid;}Tree;int cnt=0;void initTree(Tree *&T){ char str; cin>>s

2017-03-18 18:54:10 1801

原创 【数据结构_树_Tree_0975】利用二叉树统计结点度为2的数

就是一个树有几个两叉的那种,给一个我写的特例;A#BC##E##--------------------1#include #include #include using namespace std;typedef struct node { char data; struct node *L_Kid,*R_Kid;}Tree;int cnt=0;

2017-03-18 18:50:14 1186

原创 【数据结构_树_Tree_0973】利用二叉树计算叶结点个数

什么是叶结点?点击打开链接#include #include #include using namespace std;typedef struct node{ char data; struct node *L_Kid,*R_Kid;}Tree;int cnt=0;void initTree(Tree *&T){ char str; cin>>str; i

2017-03-18 18:29:55 523

原创 【数据结构_树_Tree_0972】统计利用先序计算二叉树宽度

A##ABC####AB##C##ABCD###E#F##G##A##B##-------------------------------------13241#include #include #include using namespace std;typedef s

2017-03-16 22:00:36 624

空空如也

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

TA关注的人

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