1 . Very well-known, understands the essence of the problems.
2nd Works quickly and quality.
Three Creates a good, understandable, effective code.
4 . Easy and productive to communicate
Добрый день! Нужно срочно (до полуночи 29го Апреля) выполнить следующие 2 задания (у меня есть автоматический тестер и шаблоны).
Нужно написать задания как будто их писал новичок (вы им были)!
Также, нужны комментарии, чтобы я понимал что происходит и почему.
Спасибо вам и удачи!
1. Heap
A class called MyHeap is given. Implement the follow methods: __init__(self, array) creates the initial array and build the heap using the O(n) method; insert(self, data) should insert a new element in the heap; heapify(self) should ensure that the heap property is maintained after insertion; extractFirst() should return the first element of the heap; __len__() should return the size of the heap in O(1); getData(self) should return the array.
You should use a single list to fill data.
You may not use heapq to implement this.
2. HashTable
A class called MyHashTable is given. Implement a constructor that takes two parameters: one is the size of the table to be constructed; the other a function called hash1. Implement a method put(key, data) where it hashes the key using the hash1 method, stores the data in a single list, and then return True if successfull, otherwise return False. Nothing should be done in the event of a hash collision - no data can be overwritten, and no secondary storage method should be introduced.
A class called MyChainTable that extends MyHashTable is given. Implement a constructor that takes two parameters: one is the size of the table to be constructed; the other a function called hash1. Implement a method put(key, data) where it hashes the key using the hash1 method, stores the (key, data) as a tuple in a list at the associated hash value, and should always return True.
A class called MyDoubleHashTable that extends MyHashTable is given. Implement a constructor that takes three parameters: the size of the table to be constructed; a function called hash1; and another function called hash2. Implement a method put(key,data) where it hashes the key using has1 method, stores data in a single list, and in the case where there is a collision, use the hash2 function get the offset step. Your implementation should account for if the table is full or when it cannot find a place to insert. These two cases should result in a return of False and True when the insert is successful.
PHP 70 proposals 13:25
15 proposals 11:59
Bot Development 71 proposals 31 July
Data Parsing 47 proposals 30 July
85 proposals 29 July