赞
踩
根据实验报告模板详细书写实验报告。
编写算法实现下列问题的求解。
实验测试数据基本要求:
第一组数据:顺序表长度n≥10,x=100, i分别为5,n,n+1,0,1,n+2
第二组数据:顺序表长度n=0,x=100,i=5
实验测试数据基本要求:
第一组数据:顺序表长度n≥10,i分别为5,n,1,n+1,0
第二组数据:顺序表长度n=0, i=5
实验测试数据基本要求:
顺序表元素为 (10,20,30,40,50,60,70,80,90,100),
x分别为25,85,110和8
实验测试数据基本要求:
第一组数据:顺序表元素为 (1,2,3,4,5,6,7,8,9,10,20,30,40,50,60)
第二组数据:顺序表元素为 (10,20,30,40,50,60,70,80,90,100)
实验测试数据基本要求:
第一组
第一个顺序表元素为 (1,3,6,10,15,16,17,18,19,20)
第二个顺序表元素为 (1,2,3,4,5,6,7,8,9,10,18,20,30)
第二组
第一个顺序表元素为 (1,3,6,10,15,16,17,18,19,20)
第二个顺序表元素为 (2,4,5,7,8,9,12,22)
第三组
第一个顺序表元素为 ()
第二个顺序表元素为 (1,2,3,4,5,6,7,8,9,10)
实验测试数据基本要求:
第一组数据:顺序表元素为 (1,2,3,4,5,6,7,8,9)
第二组数据:顺序表元素为 (1,1,2,2,2,3,4,5,5,5,6,6,7,7,8,8,9)
第三组数据:顺序表元素为 (1,2,3,4,5,5,6,7,8,8,9,9,9,9,9)
1.4* 顺序表扩展实验
(非必做内容,有兴趣的同学选做)1.(递增有序)
- #include<iostream>
- #include"标头.h"//include"seqList.h"
- using namespace std;
-
- int main() {
- int i = 1;
- int nums = 0;
- seqList ll;
- seq l = ≪
- seqList ss;
- seq s = &ss;
- initialList3(s);
-
- ss.data[0] = 1;
- ss.data[1] = 3;
- ss.data[2] = 6;
- ss.data[3] = 10;
- ss.data[4] = 15;
- ss.data[5] = 16;
- ss.data[6] = 17;
- ss.data[7] = 18;
- ss.data[8] = 19;
- ss.data[9] = 20;
- ss.len += 10;
-
- seqList ee;
- initialList(ee);
-
- while (i) {
- cout << "********************************************************************************************" << endl;
- cout << "* 欢迎您来到测试页面,现在开始您的测试 *" << endl;
- cout << "*----------------------------- 功能页面 --------------------------------------------------*" << endl;
- cout << "* 1.新建一个顺序表并进行初始化 *" << endl;
- cout << "* 2.在第i个结点位置插入值为x的结点 *" << endl;
- cout << "* 3.删除顺序表中第i个元素结点 *" << endl;
- cout << "* 4.打印输出当前顺序表 *" << endl;
- cout << "* 5.往顺序表加入n个数 *" << endl;
- cout << "* 6.在一个递增有序的顺序表L中插入一个值为x的元素,并保持其递增有序特性 *" << endl;
- cout << "* 7.将顺序表L中的奇数项和偶数项结点分解开 *" << endl;
- cout << "* 8.两个递增有序顺序表L1和L2中的公共元素,放入新的顺序表L3中 *" << endl;
- cout << "* 9.删除递增有序顺序表中的重复元素,并统计移动元素次数 *" << endl;
- cout << "* 10.附加题:1.1C=A∪B *" << endl;
- cout << "* 11.附加题:1.2C=A∩B *" << endl;
- cout << "* 12.附加题:1.3C=A-B *" << endl;
- cout << "* 13.附加题:1.4A=A∩B *" << endl;
- cout << "* 14.附加题:1.5A = A∪B *" << endl;
- cout << "* 15.附加题:1.6A=A-B *" << endl;
- cout << "* 16.附加题:2 *" << endl;
- cout << "* 17.附加题:3 *" << endl;
- cout << "* 0.退出功能页面 *" << endl;
- cout << "********************************************************************************************" << endl;
- cout << "输入你要选择的功能序号:" << endl;
- int num;
- cin >> num;
- switch (num) {
- case 0:
- i = 0;
- break;
- case 1:
- initialList3(l);
- break;
- case 2:
- cout << "请输入你想加入的元素和位置" << endl;
- elementType x;
- cin >> x;
- int y;
- cin >> y;
- listInsert3( l, x, y);
- if (l->ifError == 1) {
- cout << "溢出无法插入" << endl;
- }
- else if (l->ifError == 2) {
- cout << "边界错误,无法插入" << endl;
- }
- l->ifError = 0;
- break;
- case 3:
- cout << "请输入你要删除的元素的位置" << endl;
- int yy;
- cin >> yy;
- listDelete3(l, yy);
- if (l->ifError == 1) {
- cout << "溢出无法删除" << endl;
- }
- else if (l->ifError == 2) {
- cout << "边界错误,无法删除" << endl;
- }
- break;
- case 4:
- cout << "输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- break;
- case 5:
- cout << "想要加入的数:" << endl;
- int c;
- cin >> c;
- for (int g = 1; g <= c; g++) {
- listInsert3(l, g, g);
- }
-
- break;
- case 6:
- cout << "想要添加的值" << endl;
- elementType val;
- cin >> val;
- listInsertInTurn(l, val);
- break;
- case 7:
- cout << "原表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- ss=listDepart(ll);
- cout << "单数表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
- cout << l->data[i] << " ";
- }
- cout << endl;
- cout << "双数表输出的元素为:" << " ";
- for (int i = 0; i < s->len; i++) {
- cout << s->data[i] << " ";
- }
- break;
- case 8:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- ee=listThree(ll, ss);
- cout << "现在第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "现在第二表输出的元素为:" << " ";
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ee.len; i++) {
-
- cout << ee.data[i] << " ";
-
- }
- cout << endl;
- break;
- case 9:
- cout << "原表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl << "移动次数为:" << listDeleteTheSame( ll) << endl;
- cout << "现表输出的元素为:" << " ";
-
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- break;
- case 10:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- ee = unionSet(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ee.len; i++) {
-
- cout << ee.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 11:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- ee = intersectSet(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ee.len; i++) {
-
- cout << ee.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 12:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- ee = diffSet(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ee.len; i++) {
-
- cout << ee.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 13:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- intersectSetTheFirst(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ll.len; i++) {
-
- cout << ll.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 14:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- unionSetTheFirst(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ll.len; i++) {
-
- cout << ll.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 15:
- cout << "原第一表输出的元素为:" << " ";
- for (int i = 0; i < l->len; i++) {
-
- cout << l->data[i] << " ";
-
- }
- cout << endl;
- cout << "原第二表输出的元素为:" << " ";
-
- for (int i = 0; i < s->len; i++) {
-
- cout << s->data[i] << " ";
-
- }
- cout << endl;
- DeleteSetTheFirst(ll, ss);
- cout << "现在第三表输出的元素为:" << " ";
- for (int i = 0; i < ll.len; i++) {
-
- cout << ll.data[i] << " ";
-
- }
- cout << endl;
- system("pause");
- break;
- case 16:
- cout<<"A是B的子集吗:"<<isSubset(ll, ss);
- cout << endl;
- system("pause");
- break;
- case 17:
- cout << "两个顺序表的中位数为:" << listFindTheMiddel(ll, ss);
- cout << endl;
- system("pause");
- break;
- }
-
-
- // system("pause");
- //system("cls");
-
- }
-
-
- return 0;
- }
-
- #define MAXLEN 200
- #define elementType int
-
- typedef struct seqList
- {
- elementType data[MAXLEN];//顺序表
- int len;//记录表的长度
- int ifError = 0;//判断接下来的操作的错误种类
-
- }se,*seq;//起别名并定义指针
-
- void initialList(seqList&l) {
- l.len = 0;
- }
-
- void initialList3(seqList* l) {
- l->len = 0;
- }
-
- /*void listInsert(seqList& l, elementType x, int y) {
- int k;
- if (l.len == MAXLEN) {
- l.ifError = 1;//溢出无法插入
- }
- else if (y<1 || y>l.len + 1) {//边界错误,无法插入
- l.ifError = 2;
- }
- else {
- for (int k = l.len - 1; k >= y - 1; k--) {
- l.data[k + 1] = l.data[k];
- l.data[k] = x;
- l.len++;
- }
- }
- }*/
- void listInsert3(seq l, elementType x, int y) {
- int k;
- if (l->len == MAXLEN) {
- l->ifError = 1;//溢出无法插入
- }
- else if (y<1 || y>l->len + 1) {//边界错误,无法插入
- l->ifError = 2;
- }
- else {
- l->len++;
- for (int k = l->len - 1; k >= y - 1; k--) {
- l->data[k + 1] = l->data[k];
- l->data[k] = x;
-
- }
-
- }
- }
-
-
- /*void listInsert2(int a[], int& b, elementType x, int y, seqList l) {
- int k;
- if (b == MAXLEN) {
- l.ifError = 1;//溢出无法插入
- }
- else if (y<1 || y>b + 1) {//边界错误,无法插入
- l.ifError = 2;
- }
- else {
- for (int k = b - 1; k >= y - 1; k--) {
- a[k + 1] = a[k];
- a[k] = x;
- b++;
- }
- }
- }*/
-
- void listDelete(seqList& l,int y) {
- if (l.len <=0) {
- l.ifError = 1;//溢出无法删除
- }
- else if (y<1 || y>l.len + 1) {//边界错误,无法删除
- l.ifError = 2;
- }
- else {
- for (int i = y - 1; i <= l.len - 1; i++) {
- l.data[i - 1] = l.data[i];
-
-
- }
- l.len--;
- }
- }
-
- void listDelete3(seqList* l, int y) {
- if (l->len <= 0) {
- l->ifError = 1;//溢出无法删除
- }
- else if (y<1 || y>l->len) {//边界错误,无法删除
- l->ifError = 2;
- }
- else {
- for (int i = y - 1; i < l->len - 1; i++) {
- l->data[i] = l->data[i+1];
-
- }
- l->len--;
- }
- }
-
-
-
-
- /*void listInsertInTurn(seqList& l, elementType val) {
- if (l.len == 0) {
- l.data[0] = val;
- }
- else {
- int le = 0;
- int r = l.len - 1;
- int k;
- while (le < r) {
- int mid = le + r >>2;
- if (l.data[mid] > val) {
- r = mid-1;
- }
- else if (l.data[mid] < val) {
- le = mid+1;
- }
- else {
- k = mid;
- break;
- }
- }
- if (l.data[r] > val)k = r ;
- else {
- k = r ;
- }
- listInsert(l, val, k);
- }
- }*/
-
- void listInsertInTurn(seq l, elementType x) {
- for (int i = l->len - 1; i > 0; i--) {
- if (x <= l->data[i]) {
- if (x >= l->data[i - 1]) {
- listInsert3(l, x, i+1); //插入元素
- break;
- }
- }
-
- }
- if (x > l->data[l->len - 1]) {
- listInsert3(l, x, l->len + 1);
- }
- else if (x < l->data[0]) {
- listInsert3(l, x, 1);
- }
-
-
- }
-
-
- int listLength(seqList &l) {
- return l.len;
- }
-
- seqList listDepart(seqList & l) {
- seqList thenew;
- seq t = &thenew;//创建一个新指针
- //int len = l.len;
- initialList(thenew);
- for (int j = 0; j < l.len; j++) {
- if (l.data[j] % 2 == 1) {//判断奇偶数
- continue;
- }
- else {
- listInsert3(t, l.data[j], thenew.len+1);//在新顺序表插入
- listDelete3(&l, j+1);//从原顺序表删除
- j--;
-
- }
- }
- return thenew;
- }
-
- seqList listThree(seqList&l,seqList&dou) {
- seqList thenew;
- seq t = &thenew;//构建指针指向结构体
- initialList(thenew);//初始化
- int up = 0;
- int down = 0;
- while (up != l.len && down != dou.len) {//采用双指针
- if (l.data[up] > dou.data[down]) {
- down++;
- }
- else if (l.data[up] < dou.data[down]) {
- up++;
- }
- else {
- listInsert3(t, l.data[up], thenew.len+1);//插入到新顺序表中
- up++;
- down++;
- }
-
- }
- return thenew;//返回一个新顺序表
- }
-
- /*int listDeleteTheSame(seqList& l) {
- int r = 0;
- int ll = 0;
- int count = 0;
- int temp = l.len;
- if (l.len = 0 || l.len == 1) {
- return count;
- }
- else {
- while (r != l.len) {
- if (l.data[ll] == l.data[r]) {
- r++;
- }
- else {
- l.data[ll + 1] = l.data[r];
- ll++;
- r++;
- count++;
- }
- }
-
- l.len = r-1;
-
- }
- return count;
- }*/
-
- int listDeleteTheSame(seqList &list) {
- int count = 0;//统计移动次数
-
- if (list.len == 0||list.len==1) {
- return 0;
- }
- int pre = 0, last = 1;//pre为位于前面的下标,last为位于后面的下标
- int temp = list.len;//temp用于统计删除重复元素后的顺序表长度
- while (last < list.len) {
- //如果pre和last指代元素相同时,temp减一,last向后移动一位
- if (list.data[last] == list.data[pre]) {
- temp--;
- last++;
- }
- //如果pre和last不相邻时,证明中间含有重复元素,且该重复元素值与pre指代元素相同
- else if (pre + 1 != last) {
- //pre后移一位后,并用last指代元素覆盖pre指代元素,然后last后移一位
- list.data[++pre] = list.data[last++];
- count++;//元素移动次数加一
- }
- else
- { //pre和last相邻时,二者均后移一位
- pre++;
- last++;
- }
- }
- list.len = temp;
- return count;//返回计数值
- }
-
-
-
- seqList unionSet(seqList&a,seqList&b) {//C=A∪B
- int i=0, j=0;
- seqList thenew;
- initialList(thenew);//初始化新顺序表
- /*for (i = 0; i < lenB; i++) {
- for (j = 0; j < lenA; j++) {
- if (B[i] == A[j]) {
- thenew.data[thenew.len++] = B[i];
- break;
- }
- }
- if (j == lenA) {
- thenew.data[thenew.len++] = B[i];//储存数据
- }
- }
- for (i = 0; i < lenA; i++) {
- for (j = 0; j < lenB; j++) {
- if (B[i] == A[j]) {
- break;//之前已经存过一回数据,现在不用再存了
- }
- }
- if (j == lenB) {
- thenew.data[thenew.len++] = B[i];//储存数据
- }
- }
- listDeleteTheSame(thenew);//删除相同元素
- thenew.len--;*/
- while (i != a.len && j != b.len) {
- if (a.data[i] < b.data[j]) {//将较小元素加入表中
- thenew.data[thenew.len++] = a.data[i];
- i++;
- break;
- }
- else if (a.data[i] > b.data[j]) {
- thenew.data[thenew.len++] = b.data[i];
- j++;
-
- }
- else {
- thenew.data[thenew.len++] = b.data[i];
- i++; j++;
- }
- }
- if (i != a.len) {//判断双指针不同时结束时,剩下的元素接到新表尾
- for (int q = i; q < a.len; q++) {
- thenew.data[thenew.len++] = a.data[q];
- }
- }
- else if (i != b.len) {
- for (int q = i; q < b.len; q++) {
- thenew.data[thenew.len++] = b.data[q];
- }
- }
- return thenew;
- }
-
- seqList intersectSet(seqList&a,seqList&b) {//C=A∩B
- int i=0, j = 0;
- seqList thenew;
- initialList(thenew);
- while (i != a.len && j != b.len) {
- if (a.data[i] < b.data[j]) {
- i++;
-
- }
- else if (a.data[i] > b.data[j]) {
- j++;
-
- }
- else {
- thenew.data[thenew.len++] = b.data[j];//两个元素相同时,将该值赋给新顺序表
- i++; j++;
- }
- }
-
- return thenew;
- }
-
- seqList diffSet(seqList& a, seqList& b) {//C=A-B
- int i=0, j = 0;
- seqList thenew;
- initialList(thenew);//初始化新表
- while (i != a.len && j != b.len) {
- if (a.data[i] < b.data[j]) {
- thenew.data[thenew.len++] = a.data[i];//只有a的值小于b的值时,才将值赋给新顺序表
- i++;
- }
- else if (a.data[i] > b.data[j]) {
- j++;
-
- }
- else {
-
- i++; j++;
- }
- }
- return thenew;
- }
-
- void intersectSetTheFirst(seqList& a,seqList b) {//A∩B
- int i = 0;//双指针
- int j = 0;
- while (i != a.len) {
- if (a.data[i] < b.data[j]) {
- listDelete3(&a, i+1);//从A中删除该元素
-
- }
- else if (a.data[i] > b.data[j]) {
- j++;
-
- }
- else {
- i++; j++;//同时移动指针
- }
- }
-
- }
-
- void unionSetTheFirst(seqList&a,seqList b) {
- //A = A∪B
- int i = 0;//双指针
- int j=0;
- while (i != a.len && j != b.len) {
- if (a.data[i] < b.data[j]) {
- i++;
-
- }
- else if (a.data[i] > b.data[j]) {
- listInsert3(&a, b.data[j], i + 1);//从A中插入该元素
- j++;
-
- }
- else {
- i++; j++;//同时移动指针
- }
- }
- listDeleteTheSame(a);
- }
-
- void DeleteSetTheFirst(seqList& a, seqList b) {
- //A=A-B
- int i = 0;//双指针
- int j = 0;
- while (i != a.len && j != b.len) {
- if (a.data[i] < b.data[j]) {
- i++;
-
- }
- else if (a.data[i] > b.data[j]) {
-
- j++;
-
- }
- else {
- listDelete3(&a, i+1);//从A中删除该元素
- j++;//同时移动指针
- }
- }
-
- }
-
-
- bool isSubset(seqList A, seqList B) {
- int i, j;
- for (i = 0; i < A.len; i++) {
- for (j = 0; j < B.len; j++) {
- if (A.data[i] == B.data[j]) {//当两者值相同时,结束循环
- break;
- }
- }
- if (j == B.len) {
- return 0;//循环结束时,j=B.len则未搜索到,返回false
- }
- }
- return 1;
- }
-
- /*一个长度为L(L≥1)的升序序列S,处在第 个位置的数称为S 的中位数。例如,若序列S1 = (11, 13, 15, 17, 19),则S1 的中位数是15。两个序列的中位数是含它们所有元素的升序序列的中位数。例如,若S2 = (2, 4, 6, 8, 20),则S1 和S2 的中位数是11。
- 现有两个等长升序序列A 和B,试设计一个在时间和空间两方面都尽可能高效的算法,找出两个序列A 和B 的中位数。要求:
- (1)给出算法的基本设计思想。
- (2)根据设计思想,采用C 或C++语言描述算法,关键之处给出注释。
- (3)说明你所设计算法的时间复杂度和空间复杂度。*/
-
- elementType listFindTheMiddel(seqList a,seqList b) {
- int i = 0, j = 0;
- int L1 = a.len;
- int L2 = b.len;
- int res = (L1 + L2) % 2 == 0 ? (L1 + L2)/2: (L1 + L2) / 2+1 ;//返回中间值
- int count = 0;
- int kind =0;
- while (i != a.len && j != b.len) {//从小到大搜索到对应下标的值
- if (a.data[i] <= b.data[j]) {
- count++;
- i++;
- kind = 1;
-
-
- }
- else if (a.data[i] > b.data[j]) {
- count++;
- j++;
- kind = 2;
-
- }
- if (count == res) {
- return kind == 1 ? a.data[i - 1] : b.data[j - 1];
- }
-
- }
- if (i != a.len && count != res) {//对一个顺序表到头,但是另一个顺序表,且未搜索到对应值未到头的情况进行查找
- i++;
- count++;
- if (count == res) {
- return a.data[i - 1] ;
- }
- }
- else if (j != b.len && count != res) {
- j++;
- count++;
- if (count == res) {
- return b.data[j - 1];
- }
- }
- return -1;
- }
2.(递增有序)顺序表表示集合A、B,判定A是否B的子集。
3. (2011)(15 分)一个长度为L(L≥1)的升序序列S,处在第 个位置的数称为S 的中位数。例如,若序列S1=(11, 13, 15, 17, 19),则S1 的中位数是15。两个序列的中位数是含它们所有元素的升序序列的中位数。例如,若S2=(2, 4, 6, 8, 20),则S1 和S2 的中位数是11。
现有两个等长升序序列A 和B,试设计一个在时间和空间两方面都尽可能高效的算法,找出两个序列A 和B 的中位数。要求:
(1)给出算法的基本设计思想。
(2)根据设计思想,采用C 或C++语言描述算法,关键之处给出注释。
(3)说明你所设计算法的时间复杂度和空间复杂度。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。