Engineering

In a previous assignment, you created a set class which could store numbers. This class, called ArrayNumSet, implemented the NumSet interface. In this project, you will implement the NumSet interface for a hash-table based set class, called HashNumSet. Your HashNumSet class, as it implements NumSet, will be generic, and able to store objects of type Number or any child type of Number (such as Integer, Double, etc).Notice that the NumSet interface is missing a declaration for the get method. This method is typically used for lists, and made sense in the context of our ArrayNumSet implementation. Here though, because we are hashing elements to get array indices, having a method take an array index as a parameter is not intuitive. Indeed, Java's Set interface does not have it, so it's been removed here as well.The hash table for your set implementation will be a primitive array, and you will use the chaining method to resolve collisions. Each chain will be represented as a linked list, and the node class, ListNode, is given for you. Any additional methods you need to work with objects of ListNode you need to implement in your HashNumSet class.You'll need to write a hash function which computes the index in an array which an element can go / be looked up from. One way to do this is to create a private method in your HashNumSet class called hash like so:private int hash(Number element)This method will compute an index in the array corresponding to the given element. When we say we are going to 'hash an element', we mean computing the index in the array where that element belongs. Use the element's hash code and the length of the array in which you want to compute the index from. You must use the modulo operator (%).The hash method declaration given above takes a single parameter, the element, as a Number instead of E (the generic type parameter defined in NumSet). This is done to avoid any casting to E, for example if the element being passed to the method is retrieved from the array.When the number of elements in your array (total elements among all linked lists) becomes greater than 75% of the capacity, resize the array by doubling it. This is called a load factor, and here we will define it as num_elements / capacity, in which num_elements is the current number of elements in your array (what size() returns), and capacity is the current length of your array (what capacity() returns).Whenever you resize your array, you need to rehash all the elements currently in your set. This is required as your hash function is dependent on the size of the array, and increasing its size will affect which indices in the array your elements hash to. Hint: when you copy your elements to the new array of 2X size, hash each element during the copy so you will know which index to put each one.Be sure to resize your array as soon as the load factor becomes greater than 75%. This means you should probably check your load factor immediately after adding an element.Do not use any built-in array copy methods from Java.Your HashNumSet constructor will take a single argument for the initial capacity of the array. You will take this capacity value and use it to create an array in which the size (length) is the capacity. Then when you need to resize the array (ie, create a new one to replace the old one), the size of the new array will be double the size of the old one.null values are not supported, and a NullPointerException should be thrown whenever a null element is passed into add/contains/remove methods.Example input / outputYour program is really a class, HashNumSet, which will be instantiated once per test case and various methods called to check how your program is performing. For example, suppose your HashNumSet class is instantiated as an object called numSet holding type Integer and with initialCapacity = 2:NumSet numSet = new HashNumSet(2);Three integers are added to your set:numSet.add(5);numSet.add(3);numSet.add(7);Then your size() method is called:numSet.size();It should return 3, the number of elements in the set. Your capacity() method is called:numSet.capacity();It should return 4, the length of the primitive array. Now add another element:numSet.add(12);Now if you call numSet.size() and numSet.capacity(), you should get 4 and 8 returned, respectively. Finally, lets remove an element:numSet.remove(3);Now if you call numSet.size() and numSet.capacity(), you should get 3 and 8 returned, respectively. The test cases each have a description of what each one will be testing.
g in the latest lab you createdfreadchar - reads a single character from the filefwritechar - writes a single character to the fileadd this functionality to the fileio module you created from the you have this working create the following two proceduresfreadstring - this procedure will read characters from the file until a space is encountered.freadline - the procedures will read characters from the file until the carriage return line feed pair is encountered (0dh, 0ah)both of these procedures should take as an argument the offset of a string to fill in the edx, the eax should return the number of character read. you are also required to comment every li developers we can always learn from each other. please post code, ideas, and questions to this units discussion board. activity objectives this activity is designed to support the following learning objectives: compare the relationship of assembly language to high-level languages, and the processes of compilation, linking and execution cycles. distinguish the differences of the general-purpose registers and their uses. construct basic assembly language programs using the 80x86 architecture. evaluate the relationship of assembly language and the architecture of the machine; this includes the addressing system, how instructions and variables are stored in memory, and the fetch-and-execute cycle. develop an in-depth understanding of interrupt handling and exceptions. caution use of concepts that have not been covered up to this point in the class are not allowed and will be thought of as plagiarism. this could result in a minimum of 50% grade reduction instructions so far with the file io we have created the following functionality: openinputfile - opens file for reading openoutputfile - opens file for writing fwritestring - writes a null terminated string to the file. this uses a strlength procedure freadfile - reads a number of characters from the file please follow the video from the lecture material and create the file io module shown: