Simplify the following Boolean expression!((i ==12) || (j 15))struct Node {int value;Node* next;};1.1 Get the value of the Nth node from last node in the linked list.PARAM HEAD: the first element in the linked list:PARAM n: the number of the node counted reverselyRETURN: the value of the node, or -1 if not existsint GetValue(Node* HEAD, int n){}1.2 Delete a node WITHOUT using the HEAD pointer.PARAM p: A pointer pointed to a node in the middle of the linked list.RETURN: voidvoid Delete(Node* p){}1.3 Insert a new node before p WITHOUT using the HEAD pointerPARAM p: A pointer pointed to a node in the middle of the linked list.PARAM value: new Node valueRETURN: voidvoid Insert(Node* p, int value){}Question 2:Please write a String class with following features:

Simplify the following Boolean expression

!((i ==12) || (j > 15))

struct Node {

int value;

Node* next;

};

1.1 Get the value of the Nth node from last node in the linked list.

PARAM HEAD: the first element in the linked list:

PARAM n: the number of the node counted reversely

RETURN: the value of the node, or -1 if not exists

int GetValue(Node* HEAD, int n)

{

}

1.2 Delete a node WITHOUT using the HEAD pointer.

PARAM p: A pointer pointed to a node in the middle of the linked list.

RETURN: void

void Delete(Node* p)

{

}

1.3 Insert a new node before p WITHOUT using the HEAD pointer

PARAM p: A pointer pointed to a node in the middle of the linked list.

PARAM value: new Node value

RETURN: void

void Insert(Node* p, int value)

{

}

Question 2:

Please write a String class with following features:


相关考题:

以下程序输出正确的是_______ amovep(int *p,int (*a)[3],int n) { int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5}, {2,4,6}}; p=(int*)mallox(100) amovep)p,a,3); printf("%d%d\n",p[2],p[5]);free(p) }A.56B.25C.34D.程序错误

以下程序输出正确的是 ______。amovep(int *P,int(*A) [3],int n) {int i,j; for(i=0;i<n;i++ for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5},{2,4,6}}; p=(int*)malloc(100); amovep(p,a,3); printf("%d%d\n",p[2],p[5]);free(p); }A.56B.25C.34D.程序错误

下面程序的输出结果是______。 main() { int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23}; int(*p)[4]=a,i,j,k=0; for(i=0;i<3;i++) for(j=0;j<2;j++) k=p[i][j]; printf("%d\n",k); }A.17B.18C.19D.23

以下程序中,fun函数的功能足求3行4列二维数组每行尢素中的最大值。请填空。 void fun(int,int,int(*)[4],int*); main() {int a[3][4]={{12,41,36,28},{19,33,15,27},{3,27,19,1}},b[3],i; fun(3,4,a,B); for(i=0;j<3;i++)printf("%4d",b[i]); printf("\n"); } void fun(int m,int n,int ar[][4],int*br) {int i,j,x; for(i=0;i<m;i++) {x=ar[i][0]; for(j=0;j<n;j++) if(( )) x=ar[i][j]; br[i]=x; } }

12、设i、j、k均为int型变量,则执行完下面的for循环后,k的值为()。 for (i=0,j=10;i<=j;i++,j--) k=i+j ;

12、若i,j已定义成int型,则以下程序段中,内循环体的总执行次数是(). for(i=6;i>0;i--) for(j=0;j<4;j++) {…}A.30B.20C.24D.25

设 i,j,k 均为 int 型变量 , 则执行完下面的 for 循环 后 ,k 的值为 for(i=0,j=10;i<=j;i++,j--) k=i+j 设i,j,k均为int型变量,则执行完下面的for循环后, k的值为 i=0; for(j=10;i<=j;i++) { k=i+j; j=j-1;}A.10B.可以去调试来理解这个结果C.9D.11E.12

15、若i、j已定义成int型,则以下程序段中内循环体的总执行次数是()。 for(i=6;i>0;i--) for(j=0;j<4;j++){…}A.20B.24C.25D.30

boolean和int之间不能相互赋值 boolean和int之间不能相互赋值