No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
2 Posted Topics
wow!~ your code is amazing!! i am working on this project recently. but there is something wrong in your queue implementation, it is the enqueue function: while (predPtr->next) { predPtr = predPtr->next; } nPtr-> next = predPtr->next; } actually you haven't stitched your queue, that is the queue is not …
[CODE]#include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; struct Tree { char chr; Tree *left, *right; }; queue<Tree *> q; char PreOrder[500]; char InOrder[500]; bool flag[500]; int Pid; int PLen, ILen; Tree *ReBuild(int a, int b) { int id; int k; Tree *node; Pid ++; node = …
The End.
xinhedanti