CSCE 221: Data Structures and Algorithms

Sections: 507, 508, 509
Fall 2015



Homework 6.5 (Optional Assignment)


Due Date: Oct. 23rd (before class)


Assignment

This is a no penalty assignment which will replace your lowest homework grade.
  1. C-6.18 (Pg. 265)

    A useful operation in databases is the natural join. If we view a database as a list of ordered pairs of objects, then the natural join of databases A and B is the list of all ordered triples (x, y, z) such that pair (x, y) is in A and (y, z) is in B. Write pseudocode, describe its correctness (explain the algorithm), and analyze its complexity for computing the natural join of a list A of n pairs and a list B of m pairs.

  2. C-7.11 (Pg. 314)

    The balence factor of an internal node v of a binary tree is the difference between the heights of the right and left subtrees of v. Show how to specialize the Euler tour traversal of Section 7.3.7 to print the balence factors of all the nodes of a binary tree. This means define the visit actions of the tour. Describe and justify the complexity of your Euler Tour.

  3. C-7.33 (Pg. 317)

    Describe, in pseudo-code, a nonrecursive algorithm for performing an inorder traversal of a binary tree. Explain the algorithms correctness and analyze/justify the complexity of your algorithm.

  4. Describe the main aspect (one-two line explanation) of each of the major ADTs we have learned about this semester. Note I want the ADTs not implementations!


Bonus

No bonus.


Grading Rubric

Each homework composes 2% of your final grade. Each homework will be graded out of 100 possible points. In any problem asking you to design an algorithm please also provide proper pseudocode (mathematical notation), complexity analysis (both space and time), and brief justification of complexity and correctness.

All assignments must be turned in with a signed coverpage. If no coverpage is provided, the assignment will not be graded.

If there are any discrepancies in grades please see Jory Denny during his office hours (not the TA or Grader).