NUIMCrest CS211 - Algorithms and Data Structures II
Department of Computer Science, NUIM
Laboratory Sheet 11

For week beginning Monday 24 April 2000
T Naughton, NUIM
Back to CS211 home


Lab Exam 11

  • Provide solutions to problems 11.1 and 11.2.
  • No books, notes, computers allowed.
  • Use the paper provided by demonstrators.
  • You have 60 minutes.
  • Write your name below.

    Name:......................................................................... Student No:...................................

    Important: Write clearly. If necessary write out a neat and formatted version of your code separate from your rough-work.

    Problem 11.1 Write a method for an ordered binary tree that returns the number of leaf nodes in the tree.

    Problem 11.2 A class to implement a hash table of airports and their locations is required. Each airport has the following properties: a name, a three digit serial code, and a grid reference. The airport grid reference (the key) is stored as a floating point number, the airport name is stored as a character string, and the three digit code is stored as an integer.
    (a) Write a suitable class definition for this class. Include all necessary data structures and method signatures. You do not have to implement the methods.
    (b) Write a method Ratio() to determine the ratio of deleted locations to free locations in your hash table.
    (c) Write a Contains() method that determines if a given grid reference appears in the hash table.


    End of Lab Sheet