Science Homework Help
CS 300 SNHU Hash Table Data Structure Pseudocode Exercise
Prompt
For this milestone, you will be creating pseudocode for loading data into a hash table and then using it to store and print that data. There will be no programming work in this milestone; you will be developing pseudocode that will help you implement your design in a future milestone.
Please note: Throughout this milestone we are going to use the word “course” to refer to the courses in the curriculum versus “class,” which has another meaning in object-oriented programming.
For this milestone, you will:
- Design pseudocode to define how the program opens the file, reads the data from the file, parses each line, and checks for file format errors. The Course Information document, linked in the Supporting Materials section, contains all the information about all of the courses required in the Computer Science curriculum for ABCU. Each line will consist of the information about a single course, including the course number, title, and prerequisites. The Course Information document includes the course data and a diagram of how the program will execute.
Your pseudocode will need to validate the sample file to ensure it is formatted correctly and check for the following:
- Ensure there are at least two parameters on each line (some courses may not have any prerequisites).
- Ensure any prerequisite that is provided on a line exists as a course in the file. In other words, any prerequisite at the end of a line must have another line in the file that starts with that courseNumber.
- Design pseudocode to show how to create course objects and store them in the appropriate data structure. Your pseudocode should show how to create course objects, so that one course object holds data from a single line from the input file. This should load the data into the hash table data structure. Knowing the file format will help you parse and store each token of data into the appropriate course instance variable.
Hint: A loop will be needed to process all lines from the file.
- Design pseudocode that will print out course information and prerequisites. In the Pseudocode Document, linked in the Supporting Materials section, pseudocode for printing course information using a vector data structure is provided as an example. Develop the pseudocode for printing course information for the hash table data structure using the base code that has been provided.
What to Submit
To complete this milestone, you must submit the following:
Pseudocode
Your submission should include your completed pseudocode formatted as a Word Document.
Supporting Materials
The following resources will support your work on the milestone:
CS 300 Course Information
This document outlines the courses and pathway you will be designing for.
Pseudocode Document
This document provides sample pseudocode and a runtime analysis that you will use to support your work in this milestone. You already began work on the vector portion of this document during a prior milestone. For this milestone, you should add to the work you completed by writing in the hash table portion of the document you submitted previously. Note that the original Pseudocode Document is only provided again for reference.