Hashing and Graphs Presentation
Hashing and Graphs Presentation
Structures
Introduction, Key Concepts, Types,
and Applications
Hashing - Introduction
• • Hashing is a technique used to uniquely
identify a specific object from a group of
similar objects.
• • It involves mapping large amounts of data to
smaller, fixed-size values using a hash
function.
• • Commonly used for fast data retrieval in
data structures like hash tables.
Hashing Key
• • A hashing key is the unique identifier used to
generate a hash code.
• • Keys are passed through hash functions to
generate hash values.
• • Ensures rapid data access by minimizing
search time.
Types of Hashing Key
• 1. Primary Key Hashing: Uses a unique primary
key to generate hash values.
• 2. Composite Key Hashing: Combines multiple
keys to create a unique identifier.
• 3. Cryptographic Hashing: Uses secure
algorithms for encryption and verification.
• 4. Hashing for Distributed Systems: Divides
data among servers based on hash values.
Applications of Hashing
• • Hash tables and data retrieval
• • Password verification and data integrity
• • Caching and indexing in databases
• • Load balancing and distributed systems
Graph - Introduction
• • A graph is a data structure consisting of
nodes (vertices) connected by edges.
• • Used to model relationships, networks, and
connections between elements.
• • Graphs can be directed (one-way edges) or
undirected (two-way edges).
Graph Terminology
• • Vertex: The fundamental unit or node in a
graph.
• • Edge: The link between vertices in a graph.
• • Degree: The number of edges connected to
a vertex.
• • Path: A sequence of edges that connect a
series of vertices.
Graph Representation
• 1. Adjacency Matrix: A 2D array representing
connections between vertices.
• 2. Adjacency List: A list where each element
points to the nodes it is connected to.
• 3. Incidence Matrix: A matrix showing
connections between vertices and edges.
Graph Traversals
• 1. Depth-First Search (DFS): Explores as far as
possible along each branch.
• 2. Breadth-First Search (BFS): Explores all
neighbors at the present depth before moving
to nodes at the next depth level.
Applications of Graphs
• • Social networks (connections between
people)
• • Transportation networks (e.g., roads,
airways)
• • Network topology in computer science
• • Dependency graphs in project management