HW7-instructions

HW7-instructions - Homework Assignment #7 Max-heap...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Homework Assignment #7 Max-heap Implementation Margot Gerritsen Shela Aboud Emmet Caulfield February 19, 2010 1 1 Introduction Unlike previous homeworks, in this assignment, you will write a program from scratch. Exactly how you do it, while important, is your own choice provided that it meets certain specifications. As before, you will use svn to interact with your personal Subversion repository, as used from Homework #2 onward and, again, with the structure prescribed in Homework #2 , but this time, you will have to create this structure yourself there is no starting point code in the homeworks repository on cees-svn . You may collaborate and consult freely with other people, but this is not a team or group assignment your solution must be your own. We will be using MOSS to compare solutions. 2 Instructions Read every word of this entire document right through closely before you do anything else. Absolutely do not skim. 2.1 Directory Structure and Import First, create the directory structure and import it into your personal repos- itory at http://cees-svn.stanford.edu/ your-sunet-id use the structure prescribed in HW2, just as you should have done in previous homeworks. You can read more about Subversion in the online book, Version Control with Subversion . After the import operations, the trunk for this homework assignment should be at http://cees-svn.stanford.edu/ your-sunet-id /HW7/trunk this is what we will collect from cees-svn at the assignment deadline and is the entire basis for grading you do not have to submit anything via Coursework . If you cannot svn checkout your work from http://cees-svn.stanford.edu/ your- sunet-id /HW7/trunk , then neither can we. If we cant, you automatically get zero for non-submission, so make absolutely certain that you can checkout your submission from that URL before the deadline. 2.2 The Task Your task is to write a max-heap implementation (see Background in 4 ) that stores integers in a max heap. Max- and min-heaps are used to implement priority queues , which are used in some discrete event simulation algorithms including some Markov-chain Monte Carlo methods and asynchronous FVMs. Your program must present the user with a single right angle-bracket (greater- than sign) followed by a single space as a prompt, and read commands from stdin of the form: > letter [ value ] Where value is valid only for the i (insert) command and letter corresponds to one of: i <value> insert value into the max-heap, maintaining the max-heap property. x extract the value from the top of the max-heap and print that value to the terminal ( stdout ) on a line of its own with no prompt or other decoration....
View Full Document

Page1 / 10

HW7-instructions - Homework Assignment #7 Max-heap...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online