·         FOR SPRING 2008 - HERE IS YOUR PRACTICE MIDTERM

http://www.ecst.csuchico.edu/~melody/courses/Spring2008CSCI311/medianfunction1.htm

 

http://www.ecst.csuchico.edu/~melody/courses/Spring2008CSCI311/medianfunction2.htm

 

http://www.ecst.csuchico.edu/~melody/courses/Spring2008CSCI311/mid_prog_prob.htm

 

http://www.ecst.csuchico.edu/~melody/courses/Spring2008CSCI311/Practice_final_answers.htm

******************************************

Here are your new homework assignments for Fall 2008 :

New Assignment Due December 4:

Perform the heapsort algorithm as demonstrated in class on the max heap below:

array index        0        1        2        3        4        5        6        7        8

heap value        50     30     40      20      25      39      29       8       19

 

Suggestion: show the sort as using "swaps" of data elements to help you keep track of

index positions more readily.

 

New Assignment Due Nov. 6 :

Use the list of values that follows for the problems immediately below: 10, 100, 15, 95, 20, 90, 25, 85, 30, 80, 35, 75, 40, 70, 45, 65, 50, 60, 55

Problem 1:

a) Insert the values above into an initially empty B tree of order 3.  Do not attempt to delay splits on inserts.

b) Delete the values from the B tree you built in part a) in the same order that you inserted them in.

Problem 2:  

a) Insert the values above into an initially empty B+ tree of order 3.  Do not attempt to delay splits on inserts.

b) Delete the values from the B+ tree you built in part a) in the same order that you inserted them in.

******************************************************************************************************************************

 

1. Already assigned drawing the "symmetric diagrams" for the insert function into an AVL tree.  

2. Due: Thursday, Sept. 18.  Apply the recursion removal technique covered in the notes and AVL programming assignment to remove recursion from the following function:

void jump(int p, int n)

{

int temp = 3*p;

if (temp <= 30)

{

cout << "what?" << endl;

jump(p+2, n-1);

cout << “hello” << endl;

}

      else if n >= 2

            {

            cout << “back again” << endl;

            jump(p*3, n-5);

            temp = p-10;

            jump(p*2, n-7);

            cout << “must continue” << endl;

            }

      temp= p*n;

      cout << “goodbye” << endl;

}

             

 *****************************************************************************************************************************

BELOW THIS POINT ARE OLD SPRING 2008 HOMEWORK ASSIGNMENTS AND OTHER COURSE HELP MATERIALS!!!

Check this section of your course home page frequently since this is where new homework assignments for the Spring 2008 semester will be posted!

Homework One, assigned Feb. 12, 2008, due on Feb. 14, 2008:

1)Using the diagram and the code on Page 367 of Kruse’s Course notes (slide 47 of 81 in the Chapter 10 notes), draw the symmetric diagram and write the code for the case of a right rotation

2) Using the deletion example on Page 372 of Kruse’s Course notes (slide 52 of 81 in Chapter 10 notes), draw the intermediate rotation and the final rotation in the double rotation case that fixes the root m of the tree after m has become critical with a -2 balance factor

Here is some code contributed by Glib Smaga to assist you in debugging your AVL Program.  It prints the trees in a graphical format:

Homework Two, assigned Feb. 28, 2008, due on Thursday, March 6 at the beginning of class.  Photocopy your assignment before you turn it in!  

Insert the following values into:

1) an initially empty Digital Search Tree.  Once you have completed the insertion of all the values then follow by deleting each one in the same order that you inserted them.  Note - use the same order for deletion - NOT the reverse order!!!

2) an initially empty Radix Search Trie.  Once you have completed the insertion of all the values then follow by deleting each one in the same order that you inserted them.

 3) an initially empty Patricia Tree.  Once you have completed the insertion of all the values then follow by deleting each one in the same order that you inserted them.

Values: 441, 102, 931, 552, 753, 250, 888, 199, 320, 350

Here is a web page with similar values to help you derive the binary representation of these values and to see how some Patricia Tree inserts and deletes would work:

http://www.ecst.csuchico.edu/~melody/courses/Spring2003CSCI151/Powerpoints_of_Lessons/PatriciaHomework_files/frame.htm