$35
Homework 06
METU CENG310
Data Structures and Algorithms with Python
1 Questions from the Textbook
Task-1: Solve the question P-7.45 from the textbook. Your deliverable has to be a module whose name is hw6.
Your work will be tested in a way similar to what is shown below.
1 from hw6 import SparseArray
2
3 sa = SparseArray (100) # All cells will have value None
4
5 sa [23] = ’C’
6 sa [24] = [1 ,2] # at this moment linked list should have only two nodes
.
7 print ( sa [23])
8 sa [25] # should return None , but internally no node #25 should exist .
9 sa [100] = 1 # should raise IndexError
2 Instructions
A Homework-06 page will be generated soon after the start date of this homework. All deliveries should
be done over ODTUClass. Please also be aware of the late penalties (Please check the Announcements –
Homework and Assignment Policy in ODTUClass if you have not already done so.). Should you have any
questions pertaining to homework tasks, please ask them in advance (not on the due date) for your own
convenience.
1