堆与二叉树(下)

接着上次的,这里主要介绍的是堆排序,二叉树的遍历,以及之前讲题时答应过的简单二叉树问题求解


堆排序

给一组数据,升序(降序)排列

思路

思考:如果排列升序,我们应该建什么堆?

首先,如果排升序,数列最后一个数是 最大数,我们的思路是通过 向上调整 或者 向下调整,数组存放的第一个数不是最小值(小堆)就是最大值(大堆),此时我们将最后一个数与第一个数交换,使得最大值放在最后,此时再使用向上调整 或者 向下调整,得到第二大的数,重复上述动作,很明显,我们需要的第一个数是最大值,因此我们需要建大堆

反之,排降序,建立小堆


代码

#include<stdio.h>
void downAdjust(int* pa, int parent, int n)
{int child = parent * 2 + 1;while (child < n){if (child + 1 < n && pa[child] > pa[child + 1]){child++;}if (pa[parent] > pa[child]){swap(&pa[parent], &pa[child]);}else{break;}parent = child;child = parent * 2 + 1;}
}
int main()
{int arr[] = { 1,3,2,5,7,4,7,4,2,5,6,8};int n = sizeof(arr) / sizeof(arr[0]);for (int i = (n - 1 - 1) / 2; i >= 0; i--){downAdjust(arr, i, n);}for (int i = n; i > 0; ){swap(&arr[0], &arr[i - 1]);downAdjust(arr, 0, --i);}for (int i = 0; i < n; i++){printf("%d ", arr[i]);}return 0;
}

topK算法

在一组数据中,选出k个最大(最小)的数

思路

如果我们选择k个最大的数,假设数组的前k个数就是最大的数,这 k个数建立 小堆,带一个数与 后面的从第 k + 1个数开始,进行比较,如果比第一个数的就换下来,然后向下调整,直到每个所有数都比较完了


代码

void downAdjust(int* pa, int parent, int n)
{int child = parent * 2 + 1;while (child < n){if (child + 1 < n && pa[child] > pa[child + 1]){child++;}if (pa[parent] > pa[child]){swap(&pa[parent], &pa[child]);}else{break;}parent = child;child = parent * 2 + 1;}
}
#include<stdio.h>
int main()
{int arr[] = { 1,6,10,3,5,8,46,23,6,25,3,40 };int n = sizeof(arr) / sizeof(arr[0]);int k = 0;scanf("%d", &k);for (int i = (k - 1 - 1) / 2; i >= 0; i--){downAdjust(arr, i, n);}for (int i = k; i < n; i++){if (arr[i] > arr[0]){swap(&arr[i], &arr[0]);downAdjust(arr, 0, k);}}for (int i = 0; i < k; i++){printf("%d ", arr[i]);}return 0;
}

五. 二叉树的实现

1. 链接结构搭建二叉树

代码

typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL *creatnode(TLType x)
{TL*pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL *tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(3);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;return tree1;
}
#include<stdio.h>
int main()
{TL* p = NULL;p = CreatTree();
}

我们搭建了一个这样的树结构:

2. 二叉树的遍历

二叉树的遍历可以分三种:前序,中序,后序,层序

a. 前序遍历:(根,左子树,右子树)

举例

这棵树的前序遍历是怎样的?(包括空树,用N表示)

val1 val2 val4 N N val5 N N val3 val6 N N val7 N N


代码实现 

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL *creatnode(TLType x)
{TL*pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL *tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
#include<stdio.h>
void PrevOrder(TL *root)
{if (root == NULL){printf("N ");return;}printf("%d ", root->val);PrevOrder(root->left);PrevOrder(root->right);
}
int main()
{TL* p = NULL;p = CreatTree();PrevOrder(p);
}

运行结果:

b. 中序遍历:(左子树,根,右子树)

举例

这棵树的中序遍历是怎样的?(包括空树,用N表示)

N val4 N val2 N val5 N val1 N val6 N val3 N val7 N


 代码实现

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL *creatnode(TLType x)
{TL*pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL *tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
#include<stdio.h>
void InOder(TL* root)
{if (root == NULL){printf("N ");return;}InOder(root->left);printf("%d ", root->val);InOder(root->right);
}
int main()
{TL* p = NULL;p = CreatTree();InOder(p);
}

运行结果:

c. 后序遍历:(左子树,右子树,根)

举例

这棵树的后序遍历是怎样的?(包括空树,用N表示)

N N val4 N N val5 val2 N N val6 N N val7 val3 val1


代码实现 

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
void PostOder(TL* root)
{if (root == NULL){printf("N ");return;}PostOder(root->left);PostOder(root->right);printf("%d ", root->val);
}
int main()
{TL* p = NULL;p = CreatTree();PostOder(p);
}

运行结果:

d. 层序遍历

一排排的遍历

画图举例

实现思路 

这里我们借助队列(可以先进先出),开辟的数组里面存放根节点的地址(通过地址可以找到左右子树,否则如果存值是没有办法找到左右子树),打印完根节点的值,就释放,存入左右子树的节点

代码实现

实现的二叉树是这样的:

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
typedef struct QueueNode
{struct QueueNode* next;TL* data;
}QNode;typedef struct Queue
{QNode* head;QNode* tail;int size;
}Que;void QueueInit(Que* pq)
{assert(pq);pq->head = pq->tail = NULL;pq->size = 0;
}void QueueDestroy(Que* pq)
{assert(pq);QNode* cur = pq->head;while (cur){QNode* next = cur->next;free(cur);cur = next;}pq->head = pq->tail = NULL;pq->size = 0;
}void QueuePush(Que* pq, TL* x)
{assert(pq);QNode* newnode = (QNode*)malloc(sizeof(QNode));if (newnode == NULL){perror("malloc fail");exit(-1);}newnode->data = x;newnode->next = NULL;if (pq->tail == NULL){pq->head = pq->tail = newnode;}else{pq->tail->next = newnode;pq->tail = newnode;}pq->size++;
}bool QueueEmpty(Que* pq)
{assert(pq);return pq->head == NULL;
}
void QueuePop(Que* pq)
{assert(pq);assert(!QueueEmpty(pq));if (pq->head->next == NULL){free(pq->head);pq->head = pq->tail = NULL;}else{QNode* next = pq->head->next;free(pq->head);pq->head = next;}pq->size--;
}TL* QueueFront(Que* pq)
{assert(pq);assert(!QueueEmpty(pq));return pq->head->data;
}int QueueSize(Que* pq)
{assert(pq);return pq->size;
}
void leverOrder(TL* root, Que* pq)
{QueuePush(pq, root);while (!QueueEmpty(pq)){TL* pa = QueueFront(pq);printf("%d ", pa->val);QueuePop(pq);if (pa->left != NULL){QueuePush(pq, pa->left);}if (pa->right != NULL){QueuePush(pq, pa->right);}}}
int main()
{TL* p = NULL;p = CreatTree();Que q;QueueInit(&q);leverOrder(p, &q);return 0;
}

运行结果:

3. 简单二叉树经典问题求解

a. 求二叉树的节点个数

思路

想要求二叉树的节点可以分成 根节点 + 左子树 + 右子树

这里的遍历类似 前序遍历

代码

实现的树是这样的:

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
int TreeSize(TL* root)
{if (root == NULL){return 0;}return 1 + TreeSize(root->left) + TreeSize(root->right);
}
int main()
{TL* p = NULL;p = CreatTree();int size = TreeSize(p);printf("%d ", size);return 0;
}

b. 求树的高度

思路

求二叉树的高度,我们需要找到到那个最长的路径,这里采用分治的思想,如果为空树,返回 0 (空树高度为 0),调用左子树和右子树都会 + 1(+ 1可以理解成加上节点的高度),对比左子树和右子树,返回高度最大的那个

注:每求一次左右节点个数时,一定要保存,否则会有很大的时间浪费


代码

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);TL* tree8 = creatnode(8);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;tree4->left = tree8;return tree1;
}
int TreeHigh(TL* root)
{if (root == NULL){return 0;}int Left = 1 + TreeHigh(root->left);int Right = 1 +  TreeHigh(root->right) ;return Left > Right ? Left : Right;
}
int main()
{TL* p = NULL;p = CreatTree();int high = TreeHigh(p);printf("%d ", high);return 0;
}

c. 求根节点的个数

思路

判断是否是根节点的方法就是判断它的左右子树是否是 空树,我们只需要遍历这棵树就行,但如果遍历时,根节点遇到空树这也是一种结束条件


代码

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);TL* tree8 = creatnode(8);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;tree4->left = tree8;return tree1;
}
int RootSize(TL* root)
{if (root == NULL){return 0;}if (root->left == NULL && root->right == NULL){return 1;}return RootSize(root->left) + RootSize(root->right);
}
int main()
{TL* p = NULL;p = CreatTree();int root = RootSize(p);printf("%d ", root);return 0;
}

d. 求倒数第k排节点的个数

思路

这个可以是求树的高度的变形,将计数倒过来


代码 

#include<stdio.h>
#include<stdlib.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);TL* tree8 = creatnode(8);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;tree4->left = tree8;return tree1;
}int TreeHigh(TL* root)
{if (root == NULL){return 0;}int Left = 1 + TreeHigh(root->left);int Right = 1 +  TreeHigh(root->right) ;return Left > Right ? Left : Right;
}
int RootKsize(TL* root,int n,int k)
{if (root == NULL){return 0;}if (n == k){return 1;}return RootKsize(root->left, n - 1, k) + RootKsize(root->right, n - 1, k);
}
int main()
{int k = 0;scanf("%d", &k);TL* p = NULL;p = CreatTree();int high = TreeHigh(p);int rootk = RootKsize(p, high, k);printf("%d ", rootk);return 0;
}

e. 判断是否是相同的树

思路

采用前序,先比较根节点是否相同,再比较左右子树是否相同

代码

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree1()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);TL* tree8 = creatnode(8);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;tree4->left = tree8;return tree1;
}
TL* CreatTree2()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(3);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;return tree1;
}
bool IsSameTree(TL* root1,TL* root2)
{if (root1 == NULL && root2 == NULL){return true;}if (root1 == NULL || root2 == NULL){return false;}if (root1->val != root2->val){return false;}return IsSameTree(root1->left, root2->left) && IsSameTree(root1->right, root2->right);
}
int main()
{TL* p = NULL;p = CreatTree1();TL* q = CreatTree2();printf("%d ", IsSameTree(p, q));return 0;
}

f. 找到某个值,返回节点的地址

思路

前序遍历完数组,如果对比左右子树,判断是否找到节点的地址

代码

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
typedef int TLType;
typedef struct TreeList
{TLType val;struct TreeList* left;struct TreeList* right;
}TL;
TL* creatnode(TLType x)
{TL* pa = (TL*)malloc(sizeof(TL));if (pa == NULL){perror("malloc");return;}TL* newnode = pa;newnode->left = newnode->right = NULL;newnode->val = x;return newnode;
}
TL* CreatTree()
{TL* tree1 = creatnode(1);TL* tree2 = creatnode(2);TL* tree3 = creatnode(2);TL* tree4 = creatnode(4);TL* tree5 = creatnode(5);TL* tree6 = creatnode(6);TL* tree7 = creatnode(7);TL* tree8 = creatnode(8);tree1->left = tree2;tree1->right = tree3;tree2->left = tree4;tree2->right = tree5;tree3->left = tree6;tree3->right = tree7;tree4->left = tree8;return tree1;
}
TL* FindRoot(TL* root,int m)
{if (root == NULL){return NULL;}if (root->val == m){return root;}TL* Left = FindRoot(root->left, m);TL* Right = FindRoot(root->right, m);if (Left == NULL && Right == NULL){return NULL;}if (Left == NULL && Right != NULL){return Right;}else {return Left;}}
int main()
{TL* p = NULL;p = CreatTree();int m = 0;scanf("%d", &m);TL *root = FindRoot(p,m);if (root == NULL){printf("找不到\n");}else{printf("%d ", root->val);}return 0;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/398131.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java new数组_Java如何使用new创建数组

java语言使用new操作符来创建数组&#xff0c;语法如下&#xff1a;arrayRefVar new dataType[arraySize];上面的语法语句做了两件事&#xff1a;一、使用dataType[arraySize]创建了一个数组。二、把新创建的数组的引用赋值给变量 arrayRefVar。数组变量的声明&#xff0c;和创…

hibernate select语句返回的类型

2019独角兽企业重金招聘Python工程师标准>>> Person类中包含有MyEvent这个类 public class Person{private Long id;private String name;private MyEvent myEvent; } 一、HQL from语句 1、结果类型&#xff1a;List<Person> from Person 或者 from Person…

RDLC系列之五 初试XAML

本章只讲解xaml部分&#xff0c;其余都和winform下一样 1.xaml代码 <Window x:Class"RDLC.WPF.MainWindow"xmlns"http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x"http://schemas.microsoft.com/winfx/2006/xaml"xmlns:r…

Android 数据库升级解决方案

转自&#xff1a;http://blog.csdn.net/leehong2005/article/details/9128501 请考虑如下情况&#xff1a; 在数据库升级时&#xff0c;不同版本的数据库&#xff0c;他们定义的表结构完全可能是不一样的&#xff0c;比如V1.0的表A有10个column&#xff0c;而在V1.1的表A有12个…

[php入门] 3、WAMP中的集成MySQL相关基础操作

前言&#xff1a;本文以小白视角了解WAMP集成开发环境中的MYSQL&#xff0c;涉及的面广而浅&#xff0c;算是导读性质。 1、启动运行熟悉WAMP中的MySQL 先有库、再有表、数据最终以记录的形式插入表中。其中对数据进行操作使用SQL语句&#xff0c;SQL是结构化的查询语言。 在wa…

apns java 证书_APNS推送服务证书制作 图文详解教程(新)

iOS消息推送的工作机制可以简单的用下图来概括&#xff1a;Provider是指某个iPhone软件的Push服务器&#xff0c;APNS是Apple Push Notification Service的缩写&#xff0c;是苹果的服务器。上图可以分为三个阶段&#xff1a;第一阶段&#xff1a;应用程序把要发送的消息、目的…

Android近场通信---NFC基础(二)(转)

转自 http://blog.csdn.net/think_soft/article/details/8171256 应用程序如何调度NFC标签 当标签调度系统完成对NFC标签和它的标识信息封装的Intent对象的创建时&#xff0c;它会把该Intent对象发送给感兴趣的应用程序。如果有多个应用程序能够处理该Intent对象&#xff0c;就…

:base(参数)

:base(必须有值)&#xff1a;作用是将父类的值继承过来&#xff0c;如果不在构造函数中加入&#xff1a;base(变量) 的话&#xff0c;原父类中的 Model则无法继承过来。 例如&#xff1a;在父类MSG_Model,有连个属性&#xff0c;如图 1.子类构造函数不写:base(参数) 2.1.子类构…

MVC5 + EF6 完整入门教程三

MVC5 EF6 完整入门教程三 原文:MVC5 EF6 完整入门教程三期待已久的EF终于来了。 学完本篇文章&#xff0c;你将会掌握基于EF数据模型的完整开发流程。 本次将会完成EF数据模型的搭建和使用。 基于这个模型&#xff0c;将之前的示例添加数据库查询验证功能。 文章提纲 概…

Expect 教程中文版

http://blog.csdn.net/chinalinuxzend/article/details/1842588原贴&#xff1a;http://blog.chinaunix.net/u/13329/showart.php?id110100 Expect 教程中文版[From] http://www.linuxeden.com/edu/doctext.php?docid799  本教程由*葫芦娃*翻译&#xff0c;并做…

IntelliTrace 调试、定位异常

最近看了一个开源数据库管理&#xff0c;然后没有认真看它的配置环境&#xff0c;想看看是什么东西&#xff0c; 然后发现有类型转换的错误&#xff0c;但是一下子也定位不到哪里出错&#xff1f; 所以对于这种一下子找不到异常在哪里的&#xff0c;可以使用intellitrace智能跟…

zedboard--zynq使用自带外设IP让ARM PS访问FPGA(八) 转载

文章来源 http://blog.chinaaet.com/detail/34609 熟悉了xps的操作&#xff0c;IP添加&#xff0c;总线连接设置&#xff0c;图形化方法检查&#xff08;open graphical design view&#xff09;&#xff0c;检查总线及端口连接。 在file下面的图标中&#xff0c;打开导出到SDK…

[php入门] 4、HTML基础入门一篇概览

[php入门] 1、从安装开发环境环境到&#xff08;庄B&#xff09;做个炫酷的登陆应用 [php入门] 2、基础核心语法大纲 [php入门] 3、WAMP中的集成MySQL相关基础操作 1、HTML的作用   HTML是超文本标记语言&#xff0c;主要用于制作页面结构&#xff1b;而经常与之一起用的CSS是…

Python3 爬虫爬取中国图书网(淘书团) 记录

本人为一名刚开始学Python爬虫的小白&#xff0c;开贴仅为记录下自己的学习历程&#xff0c;方便做review 要爬取链接&#xff1a;http://tuan.bookschina.com/ 要爬取内容&#xff1a; 图书名称&#xff0c; 图书价格&#xff0c; 以及对应预览图的link 本文用到py packages: …

java连接字符串_Java如何连接字符串

Java中的连接是将两个字符串连接在一起的操作。您可以使用加()运算符或String的concat ()方法来连接字符串。使用运算符使用运算符是在Java中连接两个字符串的最常用方法。您可以提供变量&#xff0c;数字或字符串文字(始终用双引号括起来)。例如&#xff0c;要组合字符串“I’…

分布式之延时任务方案解析

每天学习一点点 编程PDF电子书、视频教程免费下载&#xff1a;http://www.shitanlife.com/code引言 在开发中&#xff0c;往往会遇到一些关于延时任务的需求。例如 生成订单30分钟未支付&#xff0c;则自动取消生成订单60秒后,给用户发短信对上述的任务&#xff0c;我们给一个专…

mysql 搭建日志服务器_一、架构01-搭建日志服务器Rsyslog

搭建日志服务器1、环境配置环境&#xff1a;node01 192.168.32.132 rsyslog服务器node02 192.168.32.128 rsyslog客户端2、node01、node02安装rsyslog软件包[rootnode01 ~]# yum install -y rsyslog[rootnode02 ~]# yum install -y rsyslog3、修改node01上rsyslog的配置文件…

python异常值均值填充_Python 异常值分析

异常值分析是检验数据是否有录入错误以及含有不合常理的数据。忽视异常值的存在是十分危险的&#xff0c;不加剔除地把异常值包括进数据的计算分析过程中&#xff0c;对结果会产生不良影响&#xff1b;重视异常值的出现&#xff0c;分析其产生的原因&#xff0c;常常成为发现问…

近期学习清单

2019独角兽企业重金招聘Python工程师标准>>> 框架 1.编写xml性质的ioc容器demo&#xff08;附上博文一篇&#xff09; 2.编写unity形式的ioc容器demo&#xff08;附上博文一篇&#xff09; 3.编写自己的orm框架 c#语言特性 1.大量阅读有关枚举类&#xff0c;查询类…

java同名函数_浅谈Java 继承接口同名函数问题

在Java中如果一个类同时继承接口A与B&#xff0c;并且这两个接口中具有同名方法&#xff0c;会怎么样&#xff1f;动手做实验&#xff1a;interface A{void fun();}interface B{void fun();}interface C extends A,B{}public class Test implements C{Overridepublic void fun(…