Lab 11 Answer Sheet

This lab is to be worked in a group.



Name:________________________Netid:_______________Section:_______

Name:________________________Netid:_______________Section:_______

Name:________________________Netid:_______________Section:_______


Part 1: Prelab

Each blank is worth 1/6 point.

  1. (3/6 pts)
    ______________________-10__________________________

    ______________________120__________________________


    _______________________-12_________________________


  2. (4/6 pts)
    _____________x is 20___________________________


    ______________x is 50__________________________


    ______________*ptr = 50 __________________________


    ________________x = 49__________________________


  3. (2/6 pts)
    ______________crown  royal  crown_______________________



    _______________y  c_______________________________________


  4. (4/6 pts)
    __________5   10_______________________


    __________5   10_______________________


    __________10   5_______________________


    ___________15   5______________________



  5. (5/6 pts)
    __________2   1_______________________


    __________2   1_______________________


    ___________1______________________


    ____________300   0_____________________


    _____________0____________________



Part 2 and 2 together are worth 6 points. Each blank is worth 6/10 points.

Part 2: Using QuickSort

1. (24/10 points) Fill in the blanks to call the qsort function to sort the array in ascending order.


qsort( ___ nums __ , ___ ARRAY_SIZE _or 10 ____ , __ sizeof(int) __or sizeof(nums[0]) __ , ___ compAsc ____ );

2. (24/10 points) Fill in the blanks to call the qsort function to sort the array in descending order.

qsort( ___ nums __ , ___ ARRAY_SIZE _or 10 ____ , __ sizeof(int) _or sizeof(nums[0]) ___ , ___ compDesc ____ );

Part 3: Swapping Strings

3. (6/10 points) Write the first "word" in the list that begins with the letter 'w'.

______________ warped _________________________________________


4. (6/10 points) Write the last "word" in the list.

_____________ years. ______or years__with no period__________________________________