更多“I can’t stand the ____ of being left alone and having no friends coming around. ”相关问题
  • 第1题:

    阅读下列C程序和程序说明,将应填入(n)处的字句写在对应栏内。

    【说明】下面是一个用C编写的快速排序算法。为了避免最坏情况,取基准记录pivot时,采用从left、right和mid=[(left+right)/2]中取中间值,并交换到right位置的办法。数组a存放待排序的一组记录,数据类型为T,left和right是待排序子区间的最左端点和最右端点。

    void quicksort (int a[], int left, int right) {

    int temp;

    if (left<right) {

    hat pivot = median3 (a, left, right); //三者取中子程序

    int i = left, j = right-1;

    for(;;){

    while (i <j && a[i] < pivot) i++;

    while (i <j && pivot < a[j]) j--;

    if(i<j){

    temp = a[i]; a[j] = a[i]; a[i] = temp;

    i++; j--;

    }

    else break;

    }

    if (a[i] > pivot)

    {temp = a[i]; a[i] = a[right]; a[right] = temp;}

    quicksort( (1) ); //递归排序左子区间

    quieksort(a,i+1 ,right); //递归排序右子区间

    }

    }

    void median3 (int a[], int left, int right)

    { int mid=(2);

    int k = left;

    if(a[mid] < a[k])k = mid;

    if(a[high] < a[k]) k = high; //选最小记录

    int temp = a[k]; a[k] = a[left]; a[left] = temp; //最小者交换到 left

    if(a[mid] < a[right])

    {temp=a[mid]; a[mid]=a[right]; a[right]=temp;}

    }

    消去第二个递归调用 quicksort (a,i+1,right)。 采用循环的办法:

    void quicksort (int a[], int left, int right) {

    int temp; int i,j;

    (3) {

    int pivot = median3(a, left, right); //三者取中子程序

    i = left; j = righi-1;

    for (;; ){

    while (i<j && a[i] < pivot)i++;

    while (i<j && pivot <a[j]) j--;

    if(i <j) {

    temp = a[i]; a[j]; = a[i]; a[i]=temp;

    i++; j--;

    }

    else break;

    }

    if(a[i]>pivot){(4);a[i]=pivot;}

    quicksoft ((5)); //递归排序左子区间

    left = i+1;

    }

    }


    正确答案:(1)alefti-1 (2)(left+right+1)/2 (3)while(leftright) (4)a[right)=a[i] (5)aleft i-1
    (1)a,left,i-1 (2)(left+right+1)/2 (3)while(leftright) (4)a[right)=a[i] (5)a,left, i-1 解析:(1)a,left,i-1
    递归排序左子区间,从left到i-1元素,不包括i元素。
    (2)(left+right+1)/2
    三者取中子程序median3(a,left,right),取基准记录pivot时,采用从left、right和 mid=[(left+right)/2]中取中间值,并交换到right位置的办法。
    (3)while(leftright)
    循环直到left和right相遇。
    (4)a[right)=a[i]
    若a[i]>pivot则让a[right]=a[i]而让a[i]=pivot;。
    (5)a,left, i-1
    递归排序左子区间,从left到i-1元素,不包括i元素。

  • 第2题:

    NPN(Non-publicnetwork)是5G专网的一种组网形式,具体包括哪两种分类()

    A、(stand-alone)NPN

    B、(Non-Standalone)NPN

    C、SAbasedNPN

    D、NSAbasedNPN


    答案:AB

  • 第3题:

    ---- Look! The man at the gate ________ be our headmaster. He is always standing there every morning.

    --- - No, it ________ be him. He is holding a meeting in the office now.

    A.must, can’t B.must, mustn’t C.can’t, can’t D.can’t, mustn’t


    正确答案:A

  • 第4题:

    —_______ I return the book to the library this week?— No, you _______.You can keep it until the end of this month.

    A.Must; needn’t

    B.Can; can’t

    C.May; mustn’t

    D.Can; mustn’t


    答案:A

  • 第5题:

    下列程序段的结果为______。

    A="ABBACDDCBA"

    For I=6 T0 2 Step-2

    X=Mid(A,I,I)

    Y=Left(A,1)

    Z=Right(A,1)

    Z=X & Y & Z

    Next 1

    Print 2

    A.ABA

    B.AABAAB

    C.BBABBA

    D.ABBABA


    正确答案:C
    解析:Right(字符串,n):返回字符串的最后n个字符。Mid(字符串,P,n):从第p个字符开始,向后截取n个字符。p和n都是算术表达式。Left(字符串,n):返回“字符串”的前n个字符“&”:字符串连接运算符,将两个字符申按顺序连接起来。分析程序:因为每次循环,z都被重新赋值,所以只需要跟踪最后一次循环即可得出最终结果:最后一次循环时,I=2X=Mid("ABBACDDCBA",2,2)="BB"Y=Left("ABBACDDCBA",2)="AB"Z=Right("ABBAC,DDCBA",2)="BA"Z=X&Y&Z="BBABBA"

  • 第6题:

    【单选题】职业生涯规划的思维模式是 ()。

    A.having—》doing—》Being

    B.Being—》having—》doing

    C.doing—》having—》Being


    being-having-dong