会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
nefuer
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
5
···
7
下一页
2020年2月5日
Intent
摘要: 隐示意图如何使用
阅读全文
posted @ 2020-02-05 23:05 nefuer
阅读(214)
评论(0)
推荐(0)
2019年12月16日
树的非递归遍历
摘要: 树的非递归遍历 1 void preorderTravel(Tree *T){ 2 if(T==NULL){ 3 return; 4 } 5 stack<TreeNode *> S; 6 s.push(T); 7 8 while(!S.empty()){ 9 TreeNode *p = S.top(
阅读全文
posted @ 2019-12-16 22:45 nefuer
阅读(235)
评论(0)
推荐(0)
2019年11月13日
约瑟夫环
摘要: 用数组表示 1 #include<iostream> 2 3 using namespace std; 4 5 int main(){ 6 int a[30]; 7 bool visited[30]; 8 for(int i=0; i<30; i++){ 9 cout<<i+1<<" "; 10 a
阅读全文
posted @ 2019-11-13 20:44 nefuer
阅读(179)
评论(0)
推荐(0)
2019年11月6日
求树的宽度
摘要: 非递归求树的宽度 以后再写 递归求树的宽度 /** *递归求二叉树宽度 */ //记录每层的节点数 int count[100]; //最宽的层的宽度, 即所求树的宽度 int MaxWidth=0; int findWidth(Tree *T, int deep){ if(!T){ return
阅读全文
posted @ 2019-11-06 11:09 nefuer
阅读(1164)
评论(0)
推荐(0)
判断两棵树是否相似
摘要: 1 /** 2 *判断两棵树是否相似 3 */ 4 bool isSimilar(Tree T1, Tree T2){ 5 if(!T1 && !T2){ 6 return true; 7 }else(T1 && T2){ 8 return isSimilar(T1->left, T2->left)
阅读全文
posted @ 2019-11-06 10:49 nefuer
阅读(394)
评论(0)
推荐(0)
两序遍历递归建立二叉树
摘要: 前序中序遍历建立二叉树 1 Node * createTree1(string pres, string cens) { 2 if(pres.size() == 0 || cens.size() == 0) { 3 return nullptr; 4 } 5 Node * node = new No
阅读全文
posted @ 2019-11-06 10:43 nefuer
阅读(156)
评论(0)
推荐(0)
图的最短路径问题
摘要: Floyd 多源最短路径 先看这个理解思路 https://www.cnblogs.com/wangyuliang/p/9216365.html 看这个提高,找路径 https://blog.csdn.net/qq_35644234/article/details/60875818 Dijkstra
阅读全文
posted @ 2019-11-06 08:42 nefuer
阅读(108)
评论(0)
推荐(0)
2019年10月29日
图的相关操作
摘要: 1 #include <iostream> 2 #include <algorithm> 3 4 using namespace std; 5 const int MaxNum = 100; 6 const int INF = 99999; 7 typedef struct srcNode { 8
阅读全文
posted @ 2019-10-29 20:43 nefuer
阅读(211)
评论(0)
推荐(0)
2019年10月28日
线性表相关操作,不全但会慢慢增加
摘要: 1 #include<iostream> 2 using namespace std; 3 4 typedef struct Node{ 5 int data; 6 struct Node *next; 7 }Node; 8 9 //头插法建立链表 10 Node *createListFromHead(int a[], int n){ 11 Node *A = new Node(); 12 A-
阅读全文
posted @ 2019-10-28 20:02 nefuer
阅读(181)
评论(0)
推荐(0)
2019年10月20日
常见的排序
摘要: 常见的排序 直接插入排序、二分插入排序、希尔排序、冒泡排序、快排、简单选择排序、归并排序
阅读全文
posted @ 2019-10-20 10:37 nefuer
阅读(209)
评论(0)
推荐(0)
1
2
3
4
5
···
7
下一页
公告