摘要:
queue.h-------------#includestruct location{ int x; int y;};struct Node{ location data; Node* t; };class LinkedQueue { // FIFO对象public: LinkedQueue() {front = rear = NULL;} // 构造函数 ~LinkedQueue(); // 析构函数 bool IsEmpty() const {return ((front) ? false : true);} //locatio... 阅读全文
摘要:
stack.h------------------------------------------------#includestruct locate{ int x; int y;};class stacknode{ friend class stack;public: locate t; stacknode* link;};class stack{public: stack(); bool isempty(){return (top==NULL);} void insert(locate x); bool pop(locate& x); bool gettop(locate& 阅读全文
摘要:
#include #includeusing namespace std;int main(){cout>m>>n;clock_t start,finish;start=clock();int **a=new int *[m];for (int i=0;i=col1;i--) { a[row2][i]=num; num++; } row2--; situ=3; break;case 3:for (int i=row2;i>=row1;i--){a[i][col1]=num;num++;} col1++; situ=0; break;default:break;}}for 阅读全文