摘要:
就一个排序,重温了一次快排。#include using namespace std;void Exchange(int arr[],int i,int j){int tmp=arr[i];arr[i]=arr[j];arr[j]=tmp;return;}int Partition(int arr[],int start,int end){int pData=arr[end];int i=start;for(int j=start;j=r)return ;int q=Partition(arr,p,r);QSort(arr,p,q-1);QSort(arr,q+1,r);return ;}in 阅读全文
摘要:
重构二叉树,已知前序和中序,输出后序。#include #include using namespace std;struct treeNode{treeNode();char letter;treeNode* left;treeNode* right;};treeNode::treeNode(){left=NULL;right=NULL;}void AddNode(treeNode* node,bool left,bool right,char ch){treeNode* tmpNode=new treeNode;tmpNode->letter=ch;if(true==left){no 阅读全文