#include<conio.h>#include<string>using namespace std;typedef struct goods /*物品结构信息*/{ int goodsNo; /*物品编号*/ struct goods *link; /*另一个物品的指针*/}GOODS;typedef struct box /*箱子结构信息*/{ int remain_space; /*箱子的剩余空间*/ GOODS * head; /*箱内物品链表的头指针*/ struct box *next; /*箱子链表的后继箱子指针*/}B...
#include <iostream>#include <string>using namespace std;//主函数int main(){ int m,n; char *x,*y; int **b,**c; void LCSLength(int m,int n,char *y,char *x,int **c,int **b); void LCS(int i,int j,char *x,int**b); cout<<"请输入两个序列的长度:"<<endl; cin>>m>>n; x=new char[m]; y=new char[n]; cout<<"请输入两个序列:"<<endl;...
#include<iostream>using namespace std;int BinarySeach(int a[],int& x,int n){int left=0;int right=n-1;while(left<=right){int middle=(left+right)/2;if(x==a[middle])return middle;if(x>a[middle])left=middle+1;else right=middle-1;}return -1;}int main(){cout<<"请输入数字个数,小于50个:"<<endl;int n; while(cin...