SlideShare a Scribd company logo
Hashtable
    Rubén del Río del Blanco
                  uo168319
Java Hashtable


   Relates a key with a value.
   Any non-null object can be used as a key or as
    a value.
   Should be implemented hashcode and equals
    methods for the objects used as keys.
   Objects in the hash table have two parameters
    initial capacity and load factor.
Using Object Types




   Store pairs of type, object type key value.
Hash function

   Returns a value that represents the position in
    the table
   Using Horner's rule.

      private int hash(String key){
          int p=0;
          for(int i=0;i<key.length() && i<3;i++){
          p=(p*32+key.charAt(i))%table.length;
          }
      return p;
      }

More Related Content

PPTX
Understanding the components of standard template library
Rahul Sharma
 
PPTX
Groovy
Vijay Shukla
 
PDF
Priority Queue
Joyjit Choudhury
 
Understanding the components of standard template library
Rahul Sharma
 
Groovy
Vijay Shukla
 
Priority Queue
Joyjit Choudhury
 

What's hot (20)

PPT
2CPP16 - STL
Michael Heron
 
PDF
Python tuple
Mohammed Sikander
 
PPTX
Python dictionary
Mohammed Sikander
 
PDF
An Introduction to Part of C++ STL
乐群 陈
 
PDF
An Introduction to the C++ Standard Library
Joyjit Choudhury
 
PDF
Algorithms: I
Joyjit Choudhury
 
PPTX
Java equals hashCode Contract
Sujit Kumar
 
PPTX
Data structures and algorithms arrays
chauhankapil
 
PPT
standard template library(STL) in C++
•sreejith •sree
 
PDF
Python List Comprehensions
Yos Riady
 
PPT
List in java
nitin kumar
 
PDF
STL in C++
Surya Prakash Sahu
 
PPT
강의자료10
Young Wook Kim
 
PPTX
The JavaScript Programming Language
Mohammed Irfan Shaikh
 
ODP
C++ STL 概觀
PingLun Liao
 
PPTX
Methods common to all objects
Sandeep Chawla
 
PPT
Stl Containers
ppd1961
 
PDF
List,tuple,dictionary
nitamhaske
 
PPTX
Arrays in C++
Kashif Nawab
 
2CPP16 - STL
Michael Heron
 
Python tuple
Mohammed Sikander
 
Python dictionary
Mohammed Sikander
 
An Introduction to Part of C++ STL
乐群 陈
 
An Introduction to the C++ Standard Library
Joyjit Choudhury
 
Algorithms: I
Joyjit Choudhury
 
Java equals hashCode Contract
Sujit Kumar
 
Data structures and algorithms arrays
chauhankapil
 
standard template library(STL) in C++
•sreejith •sree
 
Python List Comprehensions
Yos Riady
 
List in java
nitin kumar
 
STL in C++
Surya Prakash Sahu
 
강의자료10
Young Wook Kim
 
The JavaScript Programming Language
Mohammed Irfan Shaikh
 
C++ STL 概觀
PingLun Liao
 
Methods common to all objects
Sandeep Chawla
 
Stl Containers
ppd1961
 
List,tuple,dictionary
nitamhaske
 
Arrays in C++
Kashif Nawab
 
Ad

Recently uploaded (20)

PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
Virus sequence retrieval from NCBI database
yamunaK13
 
PPTX
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PPTX
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
Virus sequence retrieval from NCBI database
yamunaK13
 
PROTIEN ENERGY MALNUTRITION: NURSING MANAGEMENT.pptx
PRADEEP ABOTHU
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
HEALTH CARE DELIVERY SYSTEM - UNIT 2 - GNM 3RD YEAR.pptx
Priyanshu Anand
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
Continental Accounting in Odoo 18 - Odoo Slides
Celine George
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
INTESTINALPARASITES OR WORM INFESTATIONS.pptx
PRADEEP ABOTHU
 
Ad

Hashtable

  • 1. Hashtable Rubén del Río del Blanco uo168319
  • 2. Java Hashtable  Relates a key with a value.  Any non-null object can be used as a key or as a value.  Should be implemented hashcode and equals methods for the objects used as keys.  Objects in the hash table have two parameters initial capacity and load factor.
  • 3. Using Object Types  Store pairs of type, object type key value.
  • 4. Hash function  Returns a value that represents the position in the table  Using Horner's rule. private int hash(String key){ int p=0; for(int i=0;i<key.length() && i<3;i++){ p=(p*32+key.charAt(i))%table.length; } return p; }