![](https://img-blog.csdnimg.cn/20190918140012416.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据结构与算法
数据结构与算法
vuyvuv
这个作者很懒,什么都没留下…
展开
-
栈-中缀转后缀表达式、并计算,愚蠢法
数组如 a[] 可以直接用a在函数中传递并操作,不用考虑二级指针。#include <stdlib.h>#include <stdio.h>#include <malloc.h>typedef struct Stack{ int a[100]; int top;}Stack;void setEquation(int str[]...原创 2020-03-28 22:18:33 · 141 阅读 · 0 评论 -
图:邻接矩阵的创建、深度优先遍历、广度优先遍历
要注意 visit[] 数组更新的位置,放在if内,如果放在出队时才更新,后面for会把关键字重复入队,所以更新 visit[] 的时机为入队前。#include<stdio.h>#include<malloc.h>#include<string.h>#define maxSize 30typedef char Elemtype;typedef struct MGraph{ Elemtype vex[maxSize]; int arg[max原创 2020-05-09 21:52:33 · 232 阅读 · 0 评论