CSCI 262 Data Structures--Spring 2004

    Home | | Syllabus | | Assignments | | Lecture Notes

    Assignment 7 Solutions

    Part 1:

    Solution to ternary() function

    Comparison trees

    Below is the comparison tree for the ternary function as described in the assignment:


    Table of number of comparisons

    The number of comparisons made depends on how you implemented your code. In general the numbers should be similar to the ones given below. If your numbers are much higher than the ones given below then your search algorithm is doing more comparisons than necessary.


    Part 2:
    Solutions to problems on asymptotic analysis.

    Problem 1 (E2): Ordering of functions.

    Problem 2 (E15):


    Home | | Syllabus | | Assignments | | Lecture Notes