- 博客(17)
- 收藏
- 关注
原创 二叉搜索树
中序先序求反转层序#include<iostream>#include<cstdio>#include<queue>#include<vector>using namespace std;int n;int m[35],f[35];struct node{ int l,r;}aa[35];//中序和先序遍历建树 int bui...
2020-04-22 16:59:56
148
原创 接触set
set 题接触set#include<bits/stdc++.h>using namespace std;set<int>st;int main(){ int n; scanf("%d",&n); st.insert(0); // 不用这一步是错的 for(int i=1;i<=n;i++){ int k; scanf("%d",&...
2020-04-21 10:07:02
127
原创 天梯赛map题
map!!!在这里插入代码片#include<bits/stdc++.h>using namespace std;map<string,string>mp;int main() { int n; scanf("%d",&n); char a[2],h[20],p[20]; while(n--){ scanf("%s%s%s",a,h,p);...
2020-04-17 19:18:21
165
原创 7-6 Tree Traversals Again (25分)
7-6 Tree Traversals Again (25分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered fro...
2020-03-26 14:35:39
222
原创 PTA栈
PTA7-3 Pop Sequence (25分)Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a p...
2020-03-26 10:09:03
376
原创 PTA List Leaves
PTA List Leaves基本建树加队列的广度优先搜索在这里插入代码片```#include<stdio.h>#include<stdlib.h>#include<string.h>//using namespace std;#define MAXSIZE 1000010int queue[20];//建队列int first=0;//队...
2020-03-26 08:33:55
210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅