subject

PYTHON ORDERED HASHTABLE I'm having touble with the following assignment and implementation of an array-backed ordered hashtable in python.
Ordered Hashtable
Overview
For this assignment you will update and complete the implementation of the hashtable data structure presented in class, which exposes an API mirroring that of the built-in Python dict. When iterating over its contents (supported by the __iter__, keys, values, and items methods), your updated implementation will also reflect the order in which key/value pairs were originally inserted into the hashtable. This will require that you implement the two-tiered list system described during lecture.
The operations you will implement are listed alongside their descriptions below (h refers to a hashtable):
Operation Description
h[k] = v If h does not contain key k, a new k?v mapping is added, else the value for key k is updated to v.
h[k] If h contains key k, the corresponding value is returned, else a KeyError is raised.
del h[k] If h contains key k, it is removed along with its value, else a KeyError is raised. Note that if k is re-inserted at some later point it is considered a new key (for ordering purposes).
k in h Returns True if key k is in h.
len(h) Returns the number of keys in h.
iter(h) Returns an iterator over all the keys in h, in the order they were added.
h. keys() (Same as above)
h. values() Returns an iterator over all the values in h, in the order they were added.
h. items() Returns an iterator over all the key/value pairs (as tuples) in h, in the order they were added.
Your hashtable will be provided with the initial number of buckets on creation (i. e., in __init__); your implementation must heed this value, as there may be performance ramifications if it does not.
In [ ]:

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
PYTHON ORDERED HASHTABLE I'm having touble with the following assignment and implementation of an a...
Questions
question
Mathematics, 16.04.2021 17:40
question
Mathematics, 16.04.2021 17:40
question
Mathematics, 16.04.2021 17:40
question
Chemistry, 16.04.2021 17:40
Questions on the website: 13722365