C/C++
一笑奈何go
一位爱计算机的小伙子
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
常见带障碍迷宫最短路径
#include <iostream> #include <queue> #include <stdlib.h> using namespace std; #define OBJECT -2 #define WALL 1 typedef struct{ int x,y,preX,preY,val; }Node; int step[50][50];//标...原创 2019-11-28 23:51:30 · 2512 阅读 · 2 评论 -
Floyd算法简单实现
#include <iostream> #include <string.h> #include <stdlib.h> #include <iomanip> using namespace std; //floyd实现 int** floyd(int **matrix, int n){ for(int k = 0;k < n;k++...原创 2019-11-26 22:58:37 · 362 阅读 · 0 评论 -
C语言理解指针作为形参作用域
当指针作为实参时,究竟指针所指向的值在经过function后有没有改变?接下来做一下尝试以及分析。 #include <iostream> #include <stdlib.h> using namespace std; typedef struct node *Node; struct node{ int element; }newNode; int test1...原创 2019-06-15 21:04:59 · 1094 阅读 · 0 评论 -
前缀、中缀、后缀互相转换
以中缀式子5+10*(2+6)-8 作为例子导向。 中缀->前缀 首先构造一个运算符栈,然后从右至左扫描中缀表达式。如果是操作数,则直接输出;如果是运算符,则比较优先级:若该运算符优先级大于等于栈顶元素,则将该运算符入栈,否则栈顶元素出栈并输出,直到该运算符大于等于栈顶元素的优先级时,再将该运算符压入栈中。遇到右括号直接压入栈中,如果遇到一个左括号,那么就将栈顶元素弹出并输出,直到右括号...原创 2019-08-03 21:41:46 · 3191 阅读 · 3 评论 -
用游标实现表(静态链表)
#include <iostream> #include <stdlib.h> using namespace std; //element of array typedef int ListItem; typedef struct snode *link; typedef struct snode { ListItem element; int next...原创 2019-08-01 18:31:13 · 813 阅读 · 2 评论 -
排序代码合集
排序代码合集(冒泡排序、插入排序、选择排序、快速排序、计数排序、) #include <iostream> using namespace std; /* bubble sort param: @seq: A array that will be sorted. @l: begin index include itself. @r: end index expect it...原创 2019-07-28 20:36:56 · 221 阅读 · 0 评论
分享