Session Overview
![]() |
This lecture starts by showing how hashing can be used to achieve near constant time lookups and the concept of classes as understood by a computer. It then introduces exceptions. Image courtesy of donovanbeeson on Flickr. |
Session Activities
Lecture Videos
- Lecture 10: Hashing and Classes (00:44:57)
About this Video
Topics covered: Hashing, bucket, collision, linear rehash, exceptions, classes, modules, built-in classes.
Resources
Check Yourself
What does hashing do?
› View/hide answer
What is a bucket?
› View/hide answer
What are try blocks for?
› View/hide answer
What does polymorphic mean?
› View/hide answer
What is a module?
› View/hide answer
What is an object?
› View/hide answer
Problem Sets
Problem Set 4: The Caesar Cipher (Due)
This assignment will deal with a well-known (though not very secure) encryption method called the Caesar cipher. In this problem set you will need to devise your own algorithms and will practice using recursion to solve a non-trivial problem.
- Instructions (PDF)
- Pseudocode (PDF)
- Code Files (ZIP) (This ZIP file contains: 1 .py file and 3 .txt files.)
- Solutions (ZIP) (This ZIP file contains: 2 .py files.)
Problem Set 5 (Assigned)
Problem set 5 is assigned in this session. The instructions and solutions can be found on the session page where it is due, Lecture 12 Introduction to Simulation and Random Walks.
Further Study
These optional resources are provided for students that wish to explore this topic more fully.
Readings
After watching the lecture, you may want to read some of the following resources:
- 12. Classes and objects. How to Think Like a Computer Scientist.
Related Lectures
-
6.006 Introduction to Algorithms. 6.006 lectures assume a greater level of mathematical sophistication than does 6.00SC. Read the lecture notes on:
- Hashing I: Chaining, hash functions
- Hashing II: Table doubling, Karp-Rabin
- Hashing III: Open addressing