This document defines and provides examples of graphs and their representations. It discusses:
- Graphs are data structures consisting of nodes and edges connecting nodes.
- Examples of directed and undirected graphs are given.
- Graphs can be represented using adjacency matrices or adjacency lists. Adjacency matrices store connections in a grid and adjacency lists store connections as linked lists.
- Key graph terms are defined such as vertices, edges, paths, and degrees. Properties like connectivity and completeness are also discussed.
a. Concept and Definition
b. Binary Tree
c. Introduction and application
d. Operation
e. Types of Binary Tree
• Complete
• Strictly
• Almost Complete
f. Huffman algorithm
g. Binary Search Tree
• Insertion
• Deletion
• Searching
h. Tree Traversal
• Pre-order traversal
• In-order traversal
• Post-order traversal
Slides at myblog
http://www.ashimlamichhane.com.np/2016/07/tree-slide-for-data-structure-and-algorithm/
Assignments at github
https://github.com/ashim888/dataStructureAndAlgorithm/tree/dev/Assignments/assignment_7
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
a. Concept and Definition
b. Binary Tree
c. Introduction and application
d. Operation
e. Types of Binary Tree
• Complete
• Strictly
• Almost Complete
f. Huffman algorithm
g. Binary Search Tree
• Insertion
• Deletion
• Searching
h. Tree Traversal
• Pre-order traversal
• In-order traversal
• Post-order traversal
Slides at myblog
http://www.ashimlamichhane.com.np/2016/07/tree-slide-for-data-structure-and-algorithm/
Assignments at github
https://github.com/ashim888/dataStructureAndAlgorithm/tree/dev/Assignments/assignment_7
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
It is related to Analysis and Design Of Algorithms Subject.Basically it describe basic of topological sorting, it's algorithm and step by step process to solve the example of topological sort.
This PPT is all about the Tree basic on fundamentals of B and B+ Tree with it's Various (Search,Insert and Delete) Operations performed on it and their Examples...
In computer science, tree traversal (also known as tree search) is a form of graph traversal and refers to the process of visiting (checking and/or updating) each node in a tree data structure, exactly once. Such traversals are classified by the order in which the nodes are visited. The following algorithms are described for a binary tree, but they may be generalized to other trees as well.
Breadth First Search & Depth First SearchKevin Jadiya
The slides attached here describes how Breadth first search and Depth First Search technique is used in Traversing a graph/tree with Algorithm and simple code snippet.
It is related to Analysis and Design Of Algorithms Subject.Basically it describe basic of topological sorting, it's algorithm and step by step process to solve the example of topological sort.
This PPT is all about the Tree basic on fundamentals of B and B+ Tree with it's Various (Search,Insert and Delete) Operations performed on it and their Examples...
In computer science, tree traversal (also known as tree search) is a form of graph traversal and refers to the process of visiting (checking and/or updating) each node in a tree data structure, exactly once. Such traversals are classified by the order in which the nodes are visited. The following algorithms are described for a binary tree, but they may be generalized to other trees as well.
Breadth First Search & Depth First SearchKevin Jadiya
The slides attached here describes how Breadth first search and Depth First Search technique is used in Traversing a graph/tree with Algorithm and simple code snippet.
A graph G = (V, E) consists of a set of vertices V = { V1, V2, . . . } and set of edges E = { E1, E2, . . . }. The set of unordered pairs of distinct vertices whose elements are called edges of graph G such that each edge is identified with an unordered pair (Vi, Vj) of vertices.The vertices (Vi, Vj) are said to be adjacent if there is an edge Ek which is associated to Vi and Vj. In such a case Vi and Vj are called end points and the edge Ek is said to be connect/joint of Vi and Vj.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
2. Graphs
● A data structure that consists of a set of nodes (vertices) and a
set of edges that relate the nodes to each other
● The set of edges describes relationships among the vertices .
● A graph G is defined as follows:
G=(V,E)
V(G): a finite, nonempty set of vertices
E(G): a set of edges (pairs of vertices)
2Graph
3. Examples of Graphs
● V={0,1,2,3,4}
● E={(0,1), (1,2), (0,3), (3,0), (2,2), (4,3)}
Graph 3
0
1
4
2
3
When (x,y) is an edge,
we say that x is adjacent to y, and y
is adjacent from x.
0 is adjacent to 1.
1 is not adjacent to 0.
2 is adjacent from 1.
4. Directed vs. Undirected Graphs
● Undirected edge has no orientation (no arrow head)
● Directed edge has an orientation (has an arrow head)
● Undirected graph – all edges are undirected
● Directed graph – all edges are directed
u v
directed edge
u v
undirected edge
4Graph
6. Directed graph Undirected graph
Directed Graph
● Directed edge (i, j) is incident to vertex j and
incident from vertex i
● Vertex i is adjacent to vertex j, and vertex j is
adjacent from vertex i
6Graph
7. Graph terminology
● Adjacent nodes: two nodes are adjacent if they are
connected by an edge
● Path: a sequence of vertices that connect two
nodes in a graph
● A simple path is a path in which all vertices, except
possibly in the first and last, are different.
● Complete graph: a graph in which every vertex is
directly connected to every other vertex
5 is adjacent to 7
7 is adjacent from
5
7Graph
8. Continued…
● A cycle is a simple path with the same start and
end vertex.
● The degree of vertex i is the no. of edges incident on
vertex i.
e.g., degree(2) = 2, degree(5) = 3, degree(3) = 1
Graph 8
9. Continued…
Undirected graphs are connected if there is a path
between any two vertices
Directed graphs are strongly connected if there is a path
from any one vertex to any other
Directed graphs are weakly connected if there is a path
between any two vertices, ignoring direction
A complete graph has an edge between every pair of
vertices
9Graph
10. Continued…
● Loops: edges that connect a vertex to itself
● Paths: sequences of vertices p0, p1, … pm such that
each adjacent pair of vertices are connected by an
edge
● A simple path is a path in which all vertices, except
possibly in the first and last, are different.
● Multiple Edges: two nodes may be connected by >1
edge
● Simple Graphs: have no loops and no multiple edges
10Graph
11. Graph Properties
Number of Edges – Undirected Graph
● The no. of possible pairs in an n vertex graph is
n*(n-1)
● Since edge (u,v) is the same as edge (v,u), the
number of edges in an undirected graph is n*(n-
1)/2.
Graph 11
12. Number of Edges - Directed Graph
● The no. of possible pairs in an n vertex graph is
n*(n-1)
● Since edge (u,v) is not the same as edge (v,u), the
number of edges in a directed graph is n*(n-1)
● Thus, the number of edges in a directed graph is ≤
n*(n-1)
Graph 12
13. Graph 13
• In-degree of vertex i is the number of edges incident to i (i.e.,
the number of incoming edges).
e.g., indegree(2) = 1, indegree(8) = 0
• Out-degree of vertex i is the number of edges incident from i
(i.e., the number of outgoing edges).
e.g., outdegree(2) = 1, outdegree(8) = 2
14. Graph Representation
● For graphs to be computationally useful, they have to
be conveniently represented in programs
● There are two computer representations of graphs:
● Adjacency matrix representation
● Adjacency lists representation
Graph 14
15. ● Adjacency Matrix
● A square grid of boolean values
● If the graph contains N vertices, then the grid contains
N rows and N columns
● For two vertices numbered I and J, the element at row I
and column J is true if there is an edge from I to J,
otherwise false
Graph 15
19. Adjacency Lists Representation
● A graph of n nodes is represented by a one-
dimensional array L of linked lists, where
● L[i] is the linked list containing all the nodes adjacent
from node i.
● The nodes in the list L[i] are in no particular order
Graph 19
20. Graph
Graphs: Adjacency List
● Adjacency list: for each vertex v ∈ V, store a list of
vertices adjacent to v
● Example:
● Adj[1] = {2,3}
● Adj[2] = {3}
● Adj[3] = {}
● Adj[4] = {3}
● Variation: can also keep
a list of edges coming into vertex
1
2 4
3
20
21. Graphs: Adjacency List
● How much storage is required?
● The degree of a vertex v = # incident edges
● Directed graphs have in-degree, out-degree
● For directed graphs, # of items in adjacency lists is
Σ out-degree(v) = |E|
For undirected graphs, # items in adjacency lists is
Σ degree(v) = 2 |E|
● So: Adjacency lists take O(V+E) storage
21Graph