Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Without using the built in java hash table
Write a Java program to get input from the keyboard to enter an integer.
Write a hash function to hash the integer.
Store the integer in a DataItem object.
Create a hash table to store the DataItem in the hash table at the hashed location.
Write a function to search a hash function for an integer value and display it from the DataItem
object at the hashed location
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images
Knowledge Booster
Similar questions
- which index is also reffered to as a non-clustering index? a) Bidirectional Index b) Primary Index c) Hash Index d) Secondary Indexarrow_forwardWe may utilise two methods without implementing them: countand unambiguous The DictionaryEntry object's count is returned via the Count method. whereas Clear removes all DictionaryEntry from the inner hash tableitems from the internal hash tableWrite a program that utilizes these methods:arrow_forwardThe putIfAbsent function in HashMap seems useless.arrow_forward
- import hashlib def hash_function(password, salt, al): if al == 'md5': #md5 hash = hashlib.md5(salt.encode() + password.encode()) hash.update(password.encode('utf-8')) return hash.hexdigest() + ':' + salt elif (al == 'sha1'): #sha1 hash = hashlib.sha1() hash.update(password.encode('utf-8')) return hash.hexdigest() + ':' + salt elif al == 'sha224': #sha224 hash = hashlib.sha224() hash.update(password.encode('utf-8')) return hash.hexdigest() + ':' + salt elif al == 'sha256': #sha256 hash = hashlib.sha256() hash.update(password.encode('utf-8')) return hash.hexdigest() + ':' + salt elif al == 'blake2b': #blake2b512 hash = hashlib.blake2b() hash.update(password.encode('utf-8')) return hash.hexdigest() + ':' + salt else: print("Error: No Algorithm!") if __name__ == "__main__": # TODO: create a list called hash_list that contains # the five hashing algorithsm as strings # md5, sha1, sha224, sha256, blake2b hash_list =…arrow_forwardPassword Cracking Each student should be able to access* one PassXX.hash file. This file contains 4 unsalted md5 password hashes (md5 is commonly used for hashing passwords, though it is a bit weak for modern use. It is very important to salt passwords before hashing them, since leaving them unsalted makes them easier to crack. However, many sites fail to do this). Your assignment is to use Hashcat (or another password cracking or password "recovery" tool) to retrieve the original passwords from the hashes, and submit the password/hash pairs. Each set of hashes contains 1 very easy password and 3 slightly challenging passwords of differing format. Link to hashcat: https://hashcat.net/hashcat/ Note: You will also need one or more dictionaries to perform a dictionary attack. *access: Files are accessible based on your last name. You should see a large number of files that are not accessible due to your account having a wrong last name, and one file that is accessible that lacks…arrow_forwardThe following are applications of hash functions EXCEPT FOR Question 15 options: AES encryption algorithm Storing Passwords File synchronization Digital Signaturesarrow_forward
- What is a hash function?a) A function has allocated memory to keysb) A function that computes the location of the key in the arrayc) A function that creates an arrayd) A function that computes the location of the values in the arrayarrow_forwardla) Declare and instantiate a HashMap object named hMap whose values are Integers and keys are Strings. 1b) Write a for-each loop to find the total of the values in this HashMap.arrow_forwardjava program For this question, the server contains the id, name and cgpa of some Students in a file. The client will request the server for specific data, which the server will provide to the client. Server: The server contains the data of some Students. For each student, the server contains id, name and cgpa data in a file. Here's an example of the file: data.txt101 Saif 3.52201 Hasan 3.81.... Create a similar file in you server side. The file should have at least 8 students. The client will request the server to provide the details (id, name, cgpa) of the Nth highest cgpa student in the file. If N's value is 1, the server will return the details of the student with the highest cgpa. if N's value is 3, the server will return the details of the student with the third highest cgpa. If N's value is incorrect, the server returns to the client: "Invalid request". Client: The client sends the server the value of N, which is an integer number. The client takes input the value of N…arrow_forward
- Please i need the answer using Javaarrow_forwardwrite code for :arrow_forwardExcute the Program about Hash and show me the result . Source code import java.util.*; import java.io.*; class HashTable { public static void main(String[] args) throws IOException { int key; try { BufferedReader in = new BufferedReader (new InputStreamReader(System.in)); System.out.print ("How many elements you want to enter to the hash table : "); int n = Integer.parseInt(in.readLine()); Hashtable hashTable = new Hashtable(); for(int i = 0; i < n; i++) { System.out.print("Enter key for the hash table : "); key = Integer.parseInt(in.readLine()); System.out.print("Enter value for the key : "); hashTable.put(key, in.readLine()); } Map map = new TreeMap(hashTable); System.out.println(map); } catch(NumberFormatException ne) { System.out.println(ne.getMessage() + " is not a legal value."); System.out.println("Please enter a numeric value."); System.exit(1); } } }//Endarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY