SlideShare a Scribd company logo
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) 		RDFS(3)                                    RDFS(5)                                          RDFS(6)                                              visit 7 -> RDFS(7) Mark 6 as visited Mark Pred[6] Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) 		RDFS(3)                                    RDFS(5)                                          RDFS(6)                                              RDFS(7) -> Stop no more unvisited neighbors Mark 7 as visited Mark Pred[7] Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) 		RDFS(3)                                    RDFS(5)                                          RDFS(6) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) 		RDFS(3)                                    RDFS(5) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) 		RDFS(3) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) 	      RDFS(1) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) 	RDFS(9) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 )         RDFS(8) -> Stop Recursivecalls
0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) -> Stop Recursivecalls
Example 0 8 2 9 1 7 3 6 4 5 Adjacency List Visited Table (T/F) source Pred Check our paths, does DFS find valid paths? Yes. Try some examples. Path(0) -> Path(6) -> Path(7) ->
Time Complexity of DFS(Using adjacency list) We never visited a vertex more than once We had to examine all edges of the vertices We know Σvertex v degree(v) = 2m  where m is the number of edges So, the running time of DFS is proportional to the number of edges and number of vertices (same as BFS) O(n + m) You will also see this written as: O(|v|+|e|)		|v| = number of vertices (n)			 		|e| = number of edges   (m)
DFS Tree Resulting DFS-tree. Notice it is much “deeper” than the BFS tree. Captures the structure of the recursive calls ,[object Object]
 whenever DFS returns from a vertex v, we climb up in the tree from v to its parent,[object Object]
Hash table ,[object Object]
Find
Insert
Delete. (deletions may be unnecessary in some applications)
Unlike binary search tree, AVL tree and B+-tree, the following functions cannot be done:
Minimum and maximum
Successor and predecessor
Report data within a given range
List out the data in order,[object Object]
Unrealistic solution insert, delete and find all take O(1) (worst-case) time Problem: The scheme wastes too much space if the universe is too large compared with the actual number of elements to be stored.  E.g. student IDs are 8-digit integers, so the universe size is 108, but we only have about 7000 students
Hashing Usually, m << N. h(Ki) = an integer in [0, …, m-1] called the hash value of Ki
Example applications Compilers use hash tables (symbol table) to keep track of declared variables. On-line spell checkers.  After prehashing the entire dictionary, one can check each word in constant time and print out the misspelled word in order of their appearance in the document. Useful in applications when the input keys come in sorted order.  This is a bad case for binary search tree.  AVL tree and B+-tree are harder to implement and they are not necessarily more efficient.
Hashing ,[object Object]
h: hash function
maps the universe U of keys into the slots of a hash table T[0,1,...,m-1]
an element of key k hashes to slot h(k)
h(k) is the hash value of key k,[object Object]
two keys may hash to the same slot
can we ensure that any two distinct keys get different cells?
No, if |U|>m, where m is the size of the hash table
Design a good hash function
that is fast to compute and
can minimize the number of collisions
Design a method to resolve the collisions when they occur,[object Object]

More Related Content

What's hot

Hash table
Hash tableHash table
Hash table
Rajendran
 
Hash tables
Hash tablesHash tables
Hash tables
Chester Hartin
 
Hash Tables in data Structure
Hash Tables in data StructureHash Tables in data Structure
Hash Tables in data Structure
Prof Ansari
 
Hashing
HashingHashing
Hashing
Sri Prasanna
 
Hashing
HashingHashing
Hashing
Abbas Ali
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashing
Rafi Dar
 
Hashing data
Hashing dataHashing data
Hashing data
umair khan
 
08 Hash Tables
08 Hash Tables08 Hash Tables
08 Hash Tables
Andres Mendez-Vazquez
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
Sam Light
 
Hashing
HashingHashing
Hashing
debolina13
 
Ch17 Hashing
Ch17 HashingCh17 Hashing
Ch17 Hashing
leminhvuong
 
Quadratic probing
Quadratic probingQuadratic probing
Quadratic probing
rajshreemuthiah
 
Hashing gt1
Hashing gt1Hashing gt1
Hashing gt1
Gopi Saiteja
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tables
adil raja
 
Algorithm chapter 7
Algorithm chapter 7Algorithm chapter 7
Algorithm chapter 7
chidabdu
 
Hashing 1
Hashing 1Hashing 1
Hashing 1
Shyam Khant
 
Unit 8 searching and hashing
Unit   8 searching and hashingUnit   8 searching and hashing
Unit 8 searching and hashing
Dabbal Singh Mahara
 
Hash function
Hash functionHash function
Hash function
MDPiasKhan
 
Hashing
HashingHashing
Hash tables
Hash tablesHash tables
Hash tables
Rajendran
 

What's hot (20)

Hash table
Hash tableHash table
Hash table
 
Hash tables
Hash tablesHash tables
Hash tables
 
Hash Tables in data Structure
Hash Tables in data StructureHash Tables in data Structure
Hash Tables in data Structure
 
Hashing
HashingHashing
Hashing
 
Hashing
HashingHashing
Hashing
 
Concept of hashing
Concept of hashingConcept of hashing
Concept of hashing
 
Hashing data
Hashing dataHashing data
Hashing data
 
08 Hash Tables
08 Hash Tables08 Hash Tables
08 Hash Tables
 
Analysis Of Algorithms - Hashing
Analysis Of Algorithms - HashingAnalysis Of Algorithms - Hashing
Analysis Of Algorithms - Hashing
 
Hashing
HashingHashing
Hashing
 
Ch17 Hashing
Ch17 HashingCh17 Hashing
Ch17 Hashing
 
Quadratic probing
Quadratic probingQuadratic probing
Quadratic probing
 
Hashing gt1
Hashing gt1Hashing gt1
Hashing gt1
 
Hashing and Hash Tables
Hashing and Hash TablesHashing and Hash Tables
Hashing and Hash Tables
 
Algorithm chapter 7
Algorithm chapter 7Algorithm chapter 7
Algorithm chapter 7
 
Hashing 1
Hashing 1Hashing 1
Hashing 1
 
Unit 8 searching and hashing
Unit   8 searching and hashingUnit   8 searching and hashing
Unit 8 searching and hashing
 
Hash function
Hash functionHash function
Hash function
 
Hashing
HashingHashing
Hashing
 
Hash tables
Hash tablesHash tables
Hash tables
 

Viewers also liked

Trendi zold eletrevalo
Trendi zold eletrevaloTrendi zold eletrevalo
Trendi zold eletrevalo
SimArp
 
Tekertanultulelvidam 4
Tekertanultulelvidam 4Tekertanultulelvidam 4
Tekertanultulelvidam 4
SimArp
 
Ode to nature
Ode to natureOde to nature
Ode to nature
Peter Nesteruk
 
Megujulo energiavala szegenysegellen_11feb2
Megujulo energiavala szegenysegellen_11feb2Megujulo energiavala szegenysegellen_11feb2
Megujulo energiavala szegenysegellen_11feb2
SimArp
 
Mersz ime 11maj07
Mersz ime 11maj07Mersz ime 11maj07
Mersz ime 11maj07SimArp
 
A kerekpar a_jovo_utja_alap
A kerekpar a_jovo_utja_alapA kerekpar a_jovo_utja_alap
A kerekpar a_jovo_utja_alapSimArp
 
Webdesign idepac
Webdesign idepacWebdesign idepac
Webdesign idepac
JesJosSan
 

Viewers also liked (7)

Trendi zold eletrevalo
Trendi zold eletrevaloTrendi zold eletrevalo
Trendi zold eletrevalo
 
Tekertanultulelvidam 4
Tekertanultulelvidam 4Tekertanultulelvidam 4
Tekertanultulelvidam 4
 
Ode to nature
Ode to natureOde to nature
Ode to nature
 
Megujulo energiavala szegenysegellen_11feb2
Megujulo energiavala szegenysegellen_11feb2Megujulo energiavala szegenysegellen_11feb2
Megujulo energiavala szegenysegellen_11feb2
 
Mersz ime 11maj07
Mersz ime 11maj07Mersz ime 11maj07
Mersz ime 11maj07
 
A kerekpar a_jovo_utja_alap
A kerekpar a_jovo_utja_alapA kerekpar a_jovo_utja_alap
A kerekpar a_jovo_utja_alap
 
Webdesign idepac
Webdesign idepacWebdesign idepac
Webdesign idepac
 

Similar to Presentation1

Hashing
HashingHashing
Hashing
amoldkul
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
rajshreemuthiah
 
presentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxpresentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptx
jainaaru59
 
13-hashing.ppt
13-hashing.ppt13-hashing.ppt
13-hashing.ppt
soniya555961
 
Hashing
HashingHashing
Hashing
Ghaffar Khan
 
Hashing
HashingHashing
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec II
Sajid Marwat
 
Randamization.pdf
Randamization.pdfRandamization.pdf
Randamization.pdf
Prashanth460337
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
TutorialsDuniya.com
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptx
kratika64
 
Sienna 9 hashing
Sienna 9 hashingSienna 9 hashing
Sienna 9 hashing
chidabdu
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
DataminingTools Inc
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
LISP Content
 
Lec5
Lec5Lec5
Hashing .pptx
Hashing .pptxHashing .pptx
Hashing .pptx
ParagAhir1
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
R Islam
 
03.01 hash tables
03.01 hash tables03.01 hash tables
03.01 hash tables
Jyotsna Suryadevara
 
Lec4
Lec4Lec4
4.4 hashing02
4.4 hashing024.4 hashing02
4.4 hashing02
Krish_ver2
 
18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set
Intro C# Book
 

Similar to Presentation1 (20)

Hashing
HashingHashing
Hashing
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
 
presentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptxpresentation on important DAG,TRIE,Hashing.pptx
presentation on important DAG,TRIE,Hashing.pptx
 
13-hashing.ppt
13-hashing.ppt13-hashing.ppt
13-hashing.ppt
 
Hashing
HashingHashing
Hashing
 
Hashing
HashingHashing
Hashing
 
Advance algorithm hashing lec II
Advance algorithm hashing lec IIAdvance algorithm hashing lec II
Advance algorithm hashing lec II
 
Randamization.pdf
Randamization.pdfRandamization.pdf
Randamization.pdf
 
Algorithms notes tutorials duniya
Algorithms notes   tutorials duniyaAlgorithms notes   tutorials duniya
Algorithms notes tutorials duniya
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptx
 
Sienna 9 hashing
Sienna 9 hashingSienna 9 hashing
Sienna 9 hashing
 
LISP: Introduction to lisp
LISP: Introduction to lispLISP: Introduction to lisp
LISP: Introduction to lisp
 
LISP: Introduction To Lisp
LISP: Introduction To LispLISP: Introduction To Lisp
LISP: Introduction To Lisp
 
Lec5
Lec5Lec5
Lec5
 
Hashing .pptx
Hashing .pptxHashing .pptx
Hashing .pptx
 
LR(1) and SLR(1) parsing
LR(1) and SLR(1) parsingLR(1) and SLR(1) parsing
LR(1) and SLR(1) parsing
 
03.01 hash tables
03.01 hash tables03.01 hash tables
03.01 hash tables
 
Lec4
Lec4Lec4
Lec4
 
4.4 hashing02
4.4 hashing024.4 hashing02
4.4 hashing02
 
18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set18. Dictionaries, Hash-Tables and Set
18. Dictionaries, Hash-Tables and Set
 

More from Saurabh Mishra

Sorting2
Sorting2Sorting2
Sorting2
Saurabh Mishra
 
Sorting
SortingSorting
Searching
SearchingSearching
Searching
Saurabh Mishra
 
Graps 2
Graps 2Graps 2
Graphs
GraphsGraphs
Data structures
Data structuresData structures
Data structures
Saurabh Mishra
 
Trees
TreesTrees
Binary trees1
Binary trees1Binary trees1
Binary trees1
Saurabh Mishra
 

More from Saurabh Mishra (8)

Sorting2
Sorting2Sorting2
Sorting2
 
Sorting
SortingSorting
Sorting
 
Searching
SearchingSearching
Searching
 
Graps 2
Graps 2Graps 2
Graps 2
 
Graphs
GraphsGraphs
Graphs
 
Data structures
Data structuresData structures
Data structures
 
Trees
TreesTrees
Trees
 
Binary trees1
Binary trees1Binary trees1
Binary trees1
 

Recently uploaded

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 

Recently uploaded (20)

20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 

Presentation1

  • 1. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) RDFS(3) RDFS(5) RDFS(6) visit 7 -> RDFS(7) Mark 6 as visited Mark Pred[6] Recursivecalls
  • 2. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) RDFS(3) RDFS(5) RDFS(6) RDFS(7) -> Stop no more unvisited neighbors Mark 7 as visited Mark Pred[7] Recursivecalls
  • 3. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) RDFS(3) RDFS(5) RDFS(6) -> Stop Recursivecalls
  • 4. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) RDFS(3) RDFS(5) -> Stop Recursivecalls
  • 5. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) RDFS(3) -> Stop Recursivecalls
  • 6. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) RDFS(1) -> Stop Recursivecalls
  • 7. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) RDFS(9) -> Stop Recursivecalls
  • 8. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) RDFS(8) -> Stop Recursivecalls
  • 9. 0 8 2 9 1 7 3 6 4 5 Example Adjacency List Visited Table (T/F) source Pred RDFS( 2 ) -> Stop Recursivecalls
  • 10. Example 0 8 2 9 1 7 3 6 4 5 Adjacency List Visited Table (T/F) source Pred Check our paths, does DFS find valid paths? Yes. Try some examples. Path(0) -> Path(6) -> Path(7) ->
  • 11. Time Complexity of DFS(Using adjacency list) We never visited a vertex more than once We had to examine all edges of the vertices We know Σvertex v degree(v) = 2m where m is the number of edges So, the running time of DFS is proportional to the number of edges and number of vertices (same as BFS) O(n + m) You will also see this written as: O(|v|+|e|) |v| = number of vertices (n) |e| = number of edges (m)
  • 12.
  • 13.
  • 14.
  • 15. Find
  • 17. Delete. (deletions may be unnecessary in some applications)
  • 18. Unlike binary search tree, AVL tree and B+-tree, the following functions cannot be done:
  • 21. Report data within a given range
  • 22.
  • 23. Unrealistic solution insert, delete and find all take O(1) (worst-case) time Problem: The scheme wastes too much space if the universe is too large compared with the actual number of elements to be stored. E.g. student IDs are 8-digit integers, so the universe size is 108, but we only have about 7000 students
  • 24. Hashing Usually, m << N. h(Ki) = an integer in [0, …, m-1] called the hash value of Ki
  • 25. Example applications Compilers use hash tables (symbol table) to keep track of declared variables. On-line spell checkers. After prehashing the entire dictionary, one can check each word in constant time and print out the misspelled word in order of their appearance in the document. Useful in applications when the input keys come in sorted order. This is a bad case for binary search tree. AVL tree and B+-tree are harder to implement and they are not necessarily more efficient.
  • 26.
  • 28. maps the universe U of keys into the slots of a hash table T[0,1,...,m-1]
  • 29. an element of key k hashes to slot h(k)
  • 30.
  • 31. two keys may hash to the same slot
  • 32. can we ensure that any two distinct keys get different cells?
  • 33. No, if |U|>m, where m is the size of the hash table
  • 34. Design a good hash function
  • 35. that is fast to compute and
  • 36. can minimize the number of collisions
  • 37.
  • 38. h(k) = k mod m
  • 39.
  • 40. e.g. if m=2p, then h(k) is just the p lowest-order bits of k; the hash function does not depend on all the bits
  • 41. Similarly, if the keys are decimal numbers, should not set m to be a power of 10
  • 42. It’s a good practice to set the table size m to be a prime number
  • 43. Good values for m: primes not too close to exact powers of 2
  • 44. e.g. the hash table is to hold 2000 numbers, and we don’t mind an average of 3 numbers being hashed to the same entry
  • 45.
  • 46. Most hash functions assume that the keys are natural numbers
  • 47. if keys are not natural numbers, a way must be found to interpret them as natural numbers
  • 49. Add up the ASCII values of the characters in the string
  • 51. Different permutations of the same set of characters would have the same hash value
  • 52.
  • 53. If the first 3 characters are random and the table size is 10,0007 => a reasonably equitable distribution
  • 55. English is not random
  • 56. Only 28 percent of the table can actually be hashed to (assuming a table size of 10,007)
  • 59. involves all characters in the key and be expected to distribute wella,…,z and space 272
  • 60. Collision Handling: (1) Separate Chaining Instead of a hash table, we use a table of linked list keep a linked list of keys that hash to the same value h(K) = K mod 10
  • 61.
  • 62. Compute h(K) to determine which list to traverse
  • 63. If T[h(K)] contains a null pointer, initiatize this entry to point to a linked list that contains K alone.
  • 64. If T[h(K)] is a non-empty list, we add K at the beginning of this list.
  • 65. To delete a key K
  • 66.
  • 67. Therefore, we expect that each search, insertion, and deletion can be done in constant time.
  • 68. Disadvantage: Memory allocation in linked list manipulation will slow down the program.
  • 69.
  • 70. relocate the key K to be inserted if it collides with an existing key. That is, we store K at an entry different from T[h(K)].
  • 72. what is the relocation scheme?
  • 73. how to search for K later?
  • 74. Three common methods for resolving a collision in open addressing
  • 77.
  • 78. Linear Probing f(i) =i cells are probed sequentially (with wraparound) hi(K) = (hash(K) + i) mod m Insertion: Let K be the new key to be inserted. We compute hash(K) For i = 0 to m-1 compute L = ( hash(K) + I ) mod m T[L] is empty, then we put K there and stop. If we cannot find an empty entry to put K, it means that the table is full and we should report an error.
  • 79. Linear Probing hi(K) = (hash(K) + i) mod m E.g, inserting keys 89, 18, 49, 58, 69 with hash(K)=K mod 10 To insert 58, probe T[8], T[9], T[0], T[1] To insert 69, probe T[9], T[0], T[1], T[2]
  • 80. Primary Clustering We call a block of contiguously occupied table entries a cluster On the average, when we insert a new key K, we may hit the middle of a cluster. Therefore, the time to insert K would be proportional to half the size of a cluster. That is, the larger the cluster, the slower the performance. Linear probing has the following disadvantages: Once h(K) falls into a cluster, this cluster will definitely grow in size by one. Thus, this may worsen the performance of insertion in the future. If two cluster are only separated by one entry, then inserting one key into a cluster can merge the two clusters together. Thus, the cluster size can increase drastically by a single insertion. This means that the performance of insertion can deteriorate drastically after a single insertion. Large clusters are easy targets for collisions.
  • 81. Quadratic Probing f(i) = i2 hi(K) = ( hash(K) + i2 ) mod m E.g., inserting keys 89, 18, 49, 58, 69 withhash(K) = K mod 10 To insert 58, probe T[8], T[9], T[(8+4) mod 10] To insert 69, probe T[9], T[(9+1) mod 10], T[(9+4) mod 10]
  • 82.
  • 84. probe sequence for k1: 30,30+1, 30+4, 30+9
  • 85. probe sequence for k2: 29, 29+1, 29+4, 29+9
  • 86. If the table size is prime, then a new key can always be inserted if the table is at least half empty (see proof in text book)
  • 88. Keys that hash to the same home position will probe the same alternative cells
  • 89. Simulation results suggest that it generally causes less than an extra half probe per search
  • 90.
  • 91. Double Hashing hi(K) = ( hash(K) + f(i) ) mod m; hash(K) = K mod m f(i) = i * hash2(K); hash2(K) = R - (K mod R), Example: m=10, R = 7 and insert keys 89, 18, 49, 58, 69 To insert 49, hash2(49)=7, 2nd probe is T[(9+7) mod 10] To insert 58, hash2(58)=5, 2nd probe is T[(8+5) mod 10] To insert 69, hash2(69)=1, 2nd probe is T[(9+1) mod 10]
  • 92.
  • 93. For any key K, hash2(K) must be relatively prime to the table size m. Otherwise, we will only be able to examine a fraction of the table entries.
  • 94. E.g.,if hash(K) = 0 and hash2(K) = m/2, then we can only examine the entries T[0], T[m/2], and nothing else!
  • 95.
  • 96.