hmwk_5_sol - Discrete Structures Sept 26 2011 Assignment 5:...

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

View Full Document Right Arrow Icon
Discrete Structures Sept 26 2011 Assignment 5: Due at beginning of class Monday, Oct 3rd Prof. Hopcroft *******Note: this homework is subject to the style guide on the website. Points will be deducted for homeworks not following the guidelines.******** *******Please print out and staple the grade sheet to the back of your homework!****** **********Remember Midterm this Friday! We consider this homework to be a good review.********** 1. Describe a method to store a set whose elements can be any 20-digit integer. Describe how someone using your solution can check whether or not a new element is in the set in constant time (see definitions on course website for explanation of constant time). Hint: your solution will need to deal with the possibility of collisions. Solution: The solution is to use hashing with linear probing or with linked lists. A description of hashing can be found: http://www.cs.cornell.edu/courses/CS2800/2011fa/Lectures/lec sept 21.pdf Special attention was paid to the size of the hashing array, as that is what makes hashing work. Without a correct or manageble array size, the rest of hashing does not work. 2. I wish to calculate mod 9 for very large numbers (e.g. 4756213912 mod 9). Prove that I can get the
Background image of page 1

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

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

This note was uploaded on 11/11/2011 for the course CS 2800 at Cornell University (Engineering School).

Page1 / 3

hmwk_5_sol - Discrete Structures Sept 26 2011 Assignment 5:...

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

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