Êý¾Ý½á¹¹¿Î³Ì¿ÎºóϰÌ⼯´ð°¸½âÎö

}

void InterSection(SLink *L1,SLink *L2,SLink *&L3) { }

void Subs(SLink *L1,SLink *L2,SLink *&L3)

//Çó²î¼¯

SLink *p,*q,*s,*tc;

L3=(SLink *)malloc(sizeof(SLink)); tc=L3; p=L1->next; q=L2->next;

while (p!=NULL && q!=NULL) { }

tc->next=NULL;

if (p->datadata) { }

p=p->next; q=q->next;

s=(SLink *)malloc(sizeof(SLink)); s->data=p->data; tc->next=s; tc=s; p=p->next; q=q->next; else if (p->data>q->data) else //p->data=q->data

//Çó½»¼¯

}

while (p!=NULL) { }

while (q!=NULL) { }

tc->next=NULL;

s=(SLink *)malloc(sizeof(SLink)); s->data=q->data; tc->next=s; tc=s; q=q->next;

s=(SLink *)malloc(sizeof(SLink)); s->data=p->data; tc->next=s; tc=s; p=p->next; }

p=p->next; q=q->next;

Êý¾Ý½á¹¹¼òÃ÷½Ì³Ì

{ } void main() {

SLink *A,*B,*C,*D,*E; ElemType a[]={1,3,6,8,10,20}; CreateListR(A,a,6);

//β²å·¨½¨±í

printf(\¼¯ºÏA:\ElemType b[]={2,5,6,10,16,20,30}; CreateListR(B,b,7);

//β²å·¨½¨±í

printf(\¼¯ºÏB:\printf(\ÇóA¡¢B²¢¼¯C\\n\Union(A,B,C);

//ÇóA¡¢B²¢¼¯C

printf(\¼¯ºÏC:\printf(\ÇóA¡¢B½»¼¯C\\n\InterSection(A,B,D);

//ÇóA¡¢B²¢¼¯D

printf(\¼¯ºÏD:\SLink *p,*q,*s,*tc;

L3=(SLink *)malloc(sizeof(SLink)); tc=L3; p=L1->next; q=L2->next;

while (p!=NULL && q!=NULL) { }

while (p!=NULL) { }

tc->next=NULL;

s=(SLink *)malloc(sizeof(SLink)); s->data=p->data; tc->next=s; tc=s; p=p->next; if (p->datadata) { }

else if (p->data>q->data) { }

q=q->next; p=p->next; q=q->next; else //p->data=q->data

s=(SLink *)malloc(sizeof(SLink)); s->data=p->data; tc->next=s; tc=s; p=p->next;

}

printf(\ÇóA¡¢B²î¼¯E\\n\Subs(A,B,E); DestroyList(A); DestroyList(B); DestroyList(C); DestroyList(D); DestroyList(E);

//ÇóA¡¢B²î¼¯E

printf(\¼¯ºÏE:\

Á·Ï°Ìâ3

1. µ¥ÏîÑ¡ÔñÌâ

£¨1£©Õ»ÖÐÔªËØµÄ½ø³öÔ­ÔòÊÇ£¨ £©¡£ A.ÏȽøÏȳö B.ºó½øÏȳö C.Õ»¿ÕÔò½ø D.Õ»ÂúÔò³ö ´ð£ºB

£¨2£©ÉèÒ»¸öÕ»µÄ½øÕ»ÐòÁÐÊÇA¡¢B¡¢C¡¢D£¨¼´ÔªËØA¡«DÒÀ´Îͨ¹ý¸ÃÕ»£©£¬Ôò½èÖú¸ÃÕ»ËùµÃµ½µÄÊä³öÐòÁв»¿ÉÄÜÊÇ£¨ £©¡£

A.A,B,C,D B.D,C,B,A C.A,C,D,B D.D,A,B,C ´ð£ºD

£¨3£©Ò»¸öÕ»µÄ½øÕ»ÐòÁÐÊÇa¡¢b¡¢c¡¢d¡¢e£¬ÔòÕ»µÄ²»¿ÉÄܵÄÊä³öÐòÁÐÊÇ£¨ £©¡£ A.edcba B.decba C.dceab D.abcde ´ð£ºC

£¨4£©ÒÑÖªÒ»¸öÕ»µÄ½øÕ»ÐòÁÐÊÇ1£¬2£¬3£¬¡­£¬n£¬ÆäÊä³öÐòÁеĵÚÒ»¸öÔªËØÊÇi£¨1¡Üi¡Ün£©ÔòµÚj£¨1¡Üj¡Ün£©¸ö³öÕ»ÔªËØÊÇ£¨ £©¡£

A.i B.n-i C.j-i+1 D.²»È·¶¨ ´ð£ºD

£¨5£©Éè˳ÐòÕ»stµÄÕ»¶¥Ö¸ÕëtopµÄ³õʼʱΪ-1£¬Õ»¿Õ¼ä´óСΪMaxSize£¬ÔòÅж¨stջΪջ¿ÕµÄÌõ¼þΪ£¨ £©¡£

A.st.top==-1 B.st.top!=-1 C.st.top!=MaxSize D.st.top==MaxSize ´ð£ºA

£¨6£©Éè˳ÐòÕ»stµÄÕ»¶¥Ö¸ÕëtopµÄ³õʼʱΪ-1£¬Õ»¿Õ¼ä´óСΪMaxSize£¬ÔòÅж¨stջΪջÂúµÄÌõ¼þÊÇ ¡£

A.st.top!=-1 B.st.top==-1 C.st.top!=MaxSize-1 D.st.top==MaxSize-1 ´ð£ºD

£¨7£©¶ÓÁÐÖÐÔªËØµÄ½ø³öÔ­ÔòÊÇ£¨ £©¡£ A.ÏȽøÏȳö B.ºó½øÏȳö C.Õ»¿ÕÔò½ø D.Õ»ÂúÔò³ö

Êý¾Ý½á¹¹¼òÃ÷½Ì³Ì

´ð£ºA £¨8£©ÔªËØA¡¢B¡¢C¡¢D˳ÐòÁ¬Ðø½øÈë¶ÓÁÐquºó£¬¶ÓÍ·ÔªËØÊÇ£¨ ¢Ù £©£¬¶ÓÎ²ÔªËØÊÇ£¨ ¢Ú £©¡£ A.A B.B C.C D.D ´ð£º¢ÙA ¢ÚD¡£

£¨9£©Ò»¸ö¶ÓÁеÄÈëÁÐÐòÁÐΪ1234£¬Ôò¶ÓÁпÉÄܵÄÊä³öÐòÁÐÊÇ£¨ £©¡£ A.4321 B.1234 C.1432 D.3241 ´ð£ºB

£¨10£©Ñ­»·¶ÓÁÐqu£¨¶ÓÍ·Ö¸ÕëfrontÖ¸Ïò¶ÓÊ×ÔªËØµÄǰһλÖ㬶ÓβָÕërearÖ¸Ïò¶ÓÎ²ÔªËØµÄλÖ㩵ĶÓÂúÌõ¼þÊÇ£¨ £©¡£

A. (qu.rear+1)%MaxSize==(qu.front+1)%MaxSize B. (qu.rear+1)%MaxSize==qu.front+1 C.(qu.rear+1)%MaxSize==qu.front A.qu.rear==qu.front ´ð£ºC

£¨11£©Ñ­»·¶ÓÁÐqu£¨¶ÓÍ·Ö¸ÕëfrontÖ¸Ïò¶ÓÊ×ÔªËØµÄǰһλÖ㬶ÓβָÕërearÖ¸Ïò¶ÓÎ²ÔªËØµÄλÖ㩵ĶӿÕÌõ¼þÊÇ£¨ £©¡£

A. (qu.rear+1)%MaxSize==(qu.front+1)%MaxSize B. (qu.rear+1)%MaxSize==qu.front+1 C.(qu.rear+1)%MaxSize==qu.front D.qu.rear==qu.front ´ð£ºD

£¨12£©ÉèÑ­»·¶ÓÁÐÖÐÊý×éµÄϱêÊÇ0¡«N-1£¬ÆäͷβָÕë·Ö±ðΪfºÍr£¨¶ÓÍ·Ö¸ÕëfÖ¸Ïò¶ÓÊ×ÔªËØµÄǰһλÖ㬶ÓβָÕërÖ¸Ïò¶ÓÎ²ÔªËØµÄλÖã©£¬ÔòÆäÔªËØ¸öÊýΪ£¨ £©¡£

A.r-f B.r-f-1 C.(r-f)£¥N+1 D.(r-f+N)£¥N ´ð£ºD

£¨13£©ÉèÓÐ4¸öÊý¾ÝÔªËØa¡¢b¡¢cºÍd£¬¶ÔÆä·Ö±ð½øÐÐÕ»²Ù×÷»ò¶Ó²Ù×÷¡£ÔÚ½øÕ»»ò½ø¶Ó²Ù×÷ʱ£¬°´a¡¢b¡¢c¡¢d´ÎÐòÿ´Î½øÈëÒ»¸öÔªËØ¡£¼ÙÉèÕ»»ò¶ÓµÄ³õʼ״̬¶¼Êǿա£ÏÖÒª½øÐеÄÕ»²Ù×÷ÊǽøÕ»Á½´Î£¬³öÕ»Ò»´Î£¬ÔÙ½øÕ»Á½´Î£¬³öÕ»Ò»´Î£»Õâʱ£¬µÚÒ»´Î³öÕ»µÃµ½µÄÔªËØÊÇ£¨ ¢Ù £©£¬µÚ¶þ´Î³öÕ»µÃµ½µÄÔªËØÊÇ£¨ ¢Ú £©£»ÀàËÆµØ£¬¿¼ÂǶÔÕâ4¸öÊý¾ÝÔªËØ½øÐеĶӲÙ×÷Êǽø¶ÓÁ½´Î£¬³ö¶ÓÒ»´Î£¬ÔÙ½ø¶ÓÁ½´Î£¬³ö¶ÓÒ»´Î£»Õâʱ£¬µÚÒ»´Î³ö¶ÓµÃµ½µÄÔªËØÊÇ£¨ ¢Û £©£¬µÚ¶þ´Î³ö¶ÓµÃµ½µÄÔªËØÊÇ£¨ ¢Ü £©¡£¾­²Ù×÷ºó£¬×îºóÔÚÕ»Öлò¶ÓÖеÄÔªËØ»¹ÓУ¨ ¢Ý £©¸ö¡£

¢Ù¡«¢Ü£ºA.a B.b C.c D.d ¢Ý£º A.1 B.2 C.3 D.0 ´ð£º¢ÙB ¢ÚD ¢ÛA ¢ÜB ¢ÝB

£¨14£©ÉèÕ»SºÍ¶ÓÁÐQµÄ³õʼ״̬Ϊ¿Õ£¬ÔªËØe1¡«e6ÒÀ´Îͨ¹ýÕ»S£¬Ò»¸öÔªËØ³öºó¼´½ø¶ÓÁÐQ£¬Èô6¸öÔªËØ³ö¶ÓµÄÐòÁÐÊÇe2¡¢e4¡¢e3¡¢e6¡¢e5¡¢e1£¬ÔòÕ»SµÄÈÝÁ¿ÖÁÉÙÓ¦¸ÃÊÇ£¨ £©¡£

ÁªÏµ¿Í·þ£º779662525#qq.com(#Ìæ»»Îª@)