PAT
中关村_周某
大家好,我是奔跑的洲洲
展开
-
PAT 1020 Tree Traversals 二叉树的遍历
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the cor...原创 2019-07-20 17:29:00 · 110 阅读 · 0 评论 -
PAT 甲1056 Mice and Rice 队列
队列#include#includeusing namespace std;queueq;struct mouse{int w;int rank;}mouse[1010];int main(){int NP,NG,order;scanf("%d%d",&NP,&NG);for(int i=0;i<NP;i+...原创 2019-07-17 23:31:30 · 136 阅读 · 0 评论 -
PAT 1086 Tree Traversals Again 二叉树的遍历
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 from 1 to 6) is traversed, the stac...原创 2019-07-22 23:08:45 · 148 阅读 · 0 评论