24BTPCCX22_ Data Structure Notes_FINAL
24BTPCCX22_ Data Structure Notes_FINAL
Computer is an electronic machine which is used for data processing and manipulation.
When programmer collects such type of data for processing, he would require to store all of them in
computer’s main memory.
In order to make computer work we need to know
o Representation of data in computer.
o Accessing of data.
o How to solve problem step by step.
For doing this task we use data structure.
DATA
STRUCTURE
PRIMITIVE NON
PRIMITIVE
Data types
A particular kind of data item, as defined by the values it can take, the programming language used, or
the operations that can be performed on it.
1. Create
The create operation results in reserving memory for program elements. This can be done by declaration
statement. Creation of data structure may take place either during compile-time or run-time. malloc()
function of C language is used for creation.
2. Destroy
Destroy operation destroys memory space allocated for specified data structure. free() function of C
language is used to destroy data structure.
3. Selection
Selection operation deals with accessing a particular data within a data structure.
4. Updation
It updates or modifies the data in the data structure.
5. Searching
It finds the presence of desired data item in the list of data items, it may also find the locations of all
elements that satisfy certain conditions.
6. Sorting
Sorting is a process of arranging all data items in a data structure in a particular order, say for example,
either in ascending order or in descending order.
7. Merging
Merging is a process of combining the data items of two different sorted list into a single sorted list.
8. Splitting
Splitting is a process of partitioning single list to multiple list.
9. Traversal
Traversal is a process of visiting each and every node of a list in systematic manner.
An algorithm is a procedure that you can write as a C function or program, or any other language.
Algorithm Efficiency
Some algorithms are more efficient than others. We would prefer to choose an efficient algorithm, so it
would be nice to have metrics for comparing algorithm efficiency.
The complexity of an algorithm is a function describing the efficiency of the algorithm in terms of the
amount of data the algorithm must process.
Usually there are natural units for the domain and range of this function. There are two main complexity
measures of the efficiency of an algorithm
Time complexity
Time Complexity is a function describing the amount of time an algorithm takes in terms of the
amount of input to the algorithm.
"Time" can mean the number of memory accesses performed, the number of comparisons between
integers, the number of times some inner loop is executed, or some other natural unit related to the
amount of real time the algorithm will take.
Space complexity
Space complexity is a function describing the amount of memory (space) an algorithm takes in terms
of the amount of input to the algorithm.
We often speak of "extra" memory needed, not counting the memory needed to store the input itself.
Again, we use natural (but fixed-length) units to measure this.
We can use bytes, but it's easier to use, say, number of integers used, number of fixed-sized structures,
etc. In the end, the function we come up with will be independent of the actual number of bytes
needed to represent the unit.
Space complexity is sometimes ignored because the space used is minimal and/or obvious, but
sometimes it becomes as important an issue as time.
b1, b2 b1, u2
[1,1][1,2] [1,3] [ 1 ,m ] col 1 col 2 col 3 col 4
Once we have algorithm for converting the polynomial equation to an array representation and another
algorithm for converting array to polynomial equation, then different operations in array (matrix) will be
corresponding operations of polynomial equation
0 0 0 2 0 0 10
0 6 0 0 7 0 03
0 0 0 9 0 8 00
0 4 5 0 0 0 00
Fig (a) 4 x 8 matrix
Terms 0 1 2 3 4 5 6 7 8
Row 1 1 2 2 2 3 3 4 4
Column 4 7 2 5 8 4 6 2 3
Value 2 1 6 7 3 9 8 4 5
Fig (b) Linear Representation of above matrix
0 0 6 0 9 0 0
A= 2 0 0 7 8 0 4
10 0 0 0 0 0 0
0 0 12 0 0 0 0
0 0 0 0 0 0 0
0 0 0 3 0 0 5
Here from 6X7=42 elements, only 10 are non zero. A[1,3]=6, A[1,5]=9, A[2,1]=2, A[2,4]=7, A[2,5]=8,
A[2,7]=4, A[3,1]=10, A[4,3]=12, A[6,4]=3, A[6,7]=5.
One basic method for storing such a sparse matrix is to store non-zero elements in one dimensional
array and to identify each array elements with row and column indices fig (c).
ROW COLUMN A
1 1 3 6
2 1 5 9
3 2 1 2
4 2 4 7
5 2 5 8
6 2 7 4
7 3 1 10
8 4 3 12
9 6 4 3
10 6 7
5
Fig (c )
COLUMN A
1 3 6
ROW 2 5 9
1 1 3 1 2
2 3 4 4 7
3 7 5 5 8
4 8 6 7 4
5 0 7 1 10
6 9 8 3 12
9 4 3
10 7 5
ROW NO First Column
for row no COLUMN NO
Fig(d)
A more efficient representation in terms of storage requirement and access time to the row of the
matrix is shown in fid (d). The row vector changed so that its ith element is the index to the first of the
column indices for the element in row I of the matrix.
1 3 6 1 5 9 2 1 2 2 4 7
2 5 8 2 7 4 3 1 10 4 3 12
6 4 3 6 7 5 NULL
Write algorithms for Stack Operations – PUSH, POP, PEEP
A linear list which allows insertion and deletion of an element at one end only is called stack.
The insertion operation is called as PUSH and deletion operation as POP.
The most and least accessible elements in stack are known as top and bottom of the stack respectively.
Since insertion and deletion operations are performed at one end of a stack, the elements can only be
removed in the opposite orders from that in which they were added to the stack; such a linear list is
referred to as a LIFO (last in first out) list.
A pointer TOP keeps track of the top element in the stack. Initially, when the stack is empty, TOP has a
value of “one” and so on.
Each time a new element is inserted in the stack, the pointer is incremented by “one” before, the
element is placed on the stack. The pointer is decremented by “one” each time a deletion is made from
the stack.
Applications of Stack
Recursion
Keeping track of function calls
Evaluation of expressions
Reversing characters
Servicing hardware interrupts
Solving combinatorial problems using backtracking.
Algorithm : REVPOL
Given an input string INFIX containing an infix expression which has been padded on the right with ‘)’ and
whose symbol have precedence value given by above table, a vector S used as a stack and a NEXTCHAR
which when invoked returns the next character of its argument. This algorithm converts INFIX into reverse
polish and places the result in the string POLISH. The integer variable TOP denotes the top of the stack.
Algorithm PUSH and POP are used for stack manipulation. The integer variable RANK accumulates the rank
of expression. Finally the string variable TEMP is used for temporary storage purpose.
Trace the conversion of infix to postfix form in tabular form.
(i) ( A + B * C / D - E + F / G / ( H + I ) )
Evaluate (ii) : * 7 5 2 + * 4 1 1 + / -
Empty Stack Read Operator +, Read Operator *,
pop two values pop two values
from stack opn2 = from stack opn2 =
Read and push 2, opn1 = 5, and 7, opn1 = 7, and
operands 7, 5, 2 push the answer 7 push the answer 49
2
5 7
7 5 49 Read and
push
operands
4, 1, 1
Front
Deletion Insertion
Rear
Front
Deletion Insertion
Insertion Deletion
Rear
Priority 2
O1 O2 … Oj-1 … Oj
Priority 3
B1 B2 … Bk-1 … Bk
1. [Overflow]
IF R >= N
Then write (‘OVERFLOW’)
Return
2. [Increment REAR pointer]
RR+1
3. [Insert element ]
Q[R] Y
4. [Is front pointer properly set]
IF F=0
Then F 1
Return
1. [Underflow]
IF F= 0
Then write (‘UNDERFLOW’)
Return(0) (0 denotes an empty Queue)
2. [Decrement element]
Y Q[F]
3. [Queue empty?]
IF F=R
Then F R 0
Else F F+1 (increment front pointer)
4. [Return element]
Return (Y)
Then F 1
Return
Linear Data Structure and their linked storage representation.
There are many applications where sequential allocation method is unacceptable because of following
characteristics
The linked allocation method of storage can result in both efficient use of computer storage and computer time.
A Linked List
• Main advantage of doubly linked list is we can traverse in any direction, forward or reverse.
• Other advantage of doubly linked list is we can delete a node with little trouble, since we have
pointers to the previous and next nodes. A node on a singly linked list cannot be removed unless we
have the pointer to its predecessor.
• Drawback of doubly linked list is it requires more memory compared to singly linked list because we
need an extra pointer to point previous node. •
L and R in image denote left most and right most nodes in the list.
• Left link of L node and right link of R node is NULL, indicating the end of list for each direction.
Advantages of an array
1. We can access any element of an array directly means random access is easy
2. It can be used to create other useful data structures (queues, stacks)
3. It is light on memory usage compared to other structures
Disadvantages of an array
1. Its size is fixed
2. It cannot be dynamically resized in most languages
3. It is hard to add/remove elements
4. Size of all elements must be same.
5. Rigid structure (Rigid = Inflexible or not changeable)
Memory
The pointers in linked list consume additional memory compared to an array
Size
Array is fixed sized so number of elements will be limited in stack and queue.
Size of linked list is dynamic and can be changed easily so it is flexible in number of elements
X1 Y X2 X3 X4 X5 X6
X1 X2 X3 X4
Y
Write following algorithms for singly linked list.
1) Insert at first position
2) Insert at last position
Few assumptions,
We assume that a typical element or node consists of two fields namely; an information field called
INFO and pointer field denoted by LINK. The name of a typical element is denoted by NODE.
Node
// C Structure to represent a node
struct node
info link
{
int info
struct node *link
Data Pointer to
};
next node
Function: INSERT( X, First )
Given X, a new element and FIRST is a pointer to the first element of a linked linear list. Typical node contains
INFO and LINK fields. AVAIL is a pointer to the top element of the availability stack; NEW is a temporary pointer
variable. This function inserts a new node at the first position of linked list. This function returns address of
FIRST node.
1 [Underflow?]
IF AVAIL = NULL
Then Write (“Availability Stack Underflow”) Return(FIRST)
1 [Underflow?]
IF AVAIL = NULL
Then Write (“Availability Stack Underflow”) Rn(FIRST)
1. Graph
A graph G consist of a non-empty set V called the set of nodes (points, vertices) of the
graph, a set E which is the set of edges and a mapping from the set of edges E to a set of
pairs of elements of V.
It is also convenient to write a graph as G=(V,E).
Notice that definition of graph implies that to every edge of a graph G, we can associate a
pair of nodes of the graph. If an edge X Є E is thus associated with a pair of nodes (u,v)
where u, v Є V then we says that edge x connect u and v.
2. Adjacent Nodes
Any two nodes which are connected by an edge in a graph are called adjacent node.
5. Undirected graph
A graph in which every edge is undirected is called undirected graph.
6. Mixed Graph
If some of the edges are directed and some are undirected in graph then the graph is called
mixed graph.
7. Loop (Sling)
An edge of a graph which joins a node to itself is called a loop (sling).
8. Parallel Edges
In some directed as well as undirected graphs, we may have certain pairs of nodes joined by
more than one edges, such edges are called Parallel edges.
9. Multigraph
Any graph which contains some parallel edges is called multigraph.
23. Forest
If we delete the root and its edges connecting the nodes at level 1, we obtain a set of
disjoint tree. A set of disjoint tree is a forest.
31. Sibling
Siblings are nodes that share the same parent node.
The most common operations performed on tree structure is that of traversal. This is a procedure by
which each node in the tree is processed exactly once in a systematic manner.
There are three ways of traversing a binary tree.
1. Preorder Traversal
2. Inorder Traversal
3. Postorder Traversal
A Preorder traversal : A B C D E F G
Inorder traversal : C B A E F D G
B D Postorder traversal : C B F E G D A
Inorder :DGBAHEICF
Postorder : G D B H I E F C A
D G B H E I C F
B C
D G H E I F
B C
D E F
G H I
8
Postorder : C B E H G I F D A
Inorder :BCAEDGHFI
B C E D G H F I
B D
C E G H F I
B D
C E F
G H I
B D
C E F
G I
H
Construct a tree for the given Inorder and Preorder traversals
Preorder : G B Q A C K F P D E R H
Inorder : Q B K C F A G P E D H R
Q B K C F A P E D H R
B P
Q K C F A D E R H
B P
Q A D
E R H
K C F
B P
Q A D
C E R
K F H
Create a binary search tree for the following data :
50 ,25 ,75, 22,40,60,80,90,15,30
50
25 75
22 40 80
60
15 30 90
Construct binary search tree for the following data and find its Inorder,
Preorder and Postorder traversal
10,3,15,22,6,45,65,23,78,34,5
10
3 15
6 22
5
45
23 65
34 78
A tree is called AVL (height balance binary tree), if each node possesses one of the following properties
1. A node is called left heavy if the longest path in its left sub tree is one longer then the longest path of its
right sub tree.
2. A node is called right heavy if the longest path in the right sub tree is one longer than path in its left sub
tree.
3. A node is called balanced, if the longest path in both the right and left sub tree are equal.
If tree becomes unbalanced by inserting any node, then based on position of insertion, we need to rotate the
unbalanced node. Rotation is the process to make tree balanced
1) Insertion into Left sub-tree of nodes Left child – Single Right Rotation
2) Insertion into Right sub-tree of node’s Left child – Left Right Rotation
3) Insertion into Left sub-tree of node’s Right child – Right Left Rotation
4) Insertion into Right sub-tree of node’s Right child – Single Left Rotation
1) Insertion into Left sub-tree of nodes Left child – Single Right Rotation
If node becomes unbalanced after insertion of new node at Left sub-tree of nodes Left child, then we need
to perform Single Right Rotation for unbalanced node.
Right Rotation
a. Detach leaf child’s right sub-tree
b. Consider leaf child to be the new parent
c. Attach old parent onto right of new parent
d. Attach old leaf child’s old right sub-tree as leaf sub-tree of new right child
Critical Node J K
Right J
K Z X
Rotation
X Y N Y Z
N
Critical Node 13 7
Steps of 13
7 15 Right 5
Rotation
5 10 3 10 15
7
7
5 13
5 13
3 10 15
3 10 15
2) Insertion into Right sub-tree of node’s Left child – Left Right Rotation
If node becomes unbalanced after insertion of new node at Right sub-tree of node’s Left child, then we need
to perform Left Right Rotation for unbalanced node.
J J Y
Y Z K J
K Z
Left Right
Rotation of K Rotation of J
X Y K n X n Z
n X
3) Insertion into Left sub-tree of node’s Right child – Right Left Rotation
If node becomes unbalanced after insertion of new node at Left sub-tree of node’s Right child, then we
need to perform Right Left Rotation for unbalanced node.
T1 Right T1 Y Left
Z
Rotation of Z Rotation of X X Z
T2
Y T4 Z
T1 T2 T3 T4
T3 T4
T2 T3
4) Insertion into Right sub-tree of node’s Right child – Single Left Rotation
If node becomes unbalanced after insertion of new node at Right sub-tree of nodes Right child, then we
need to perform Single Left Rotation for unbalanced node.
Left Rotation
a. Detach right child’s leaf sub-tree
b. Consider right child to be new parent
c. Attach old parent onto left of new parent
d. Attach old right child’s old left sub-tree as right sub-tree of new left child
Unbalanced node
X
Y
T1
Y Leaf
T3
Rotation of X X
T2 T3
T1 T2
n
Example
50 Unbalanced node 70 70
40 70 50 80 50 80
90
60 80 40 90 40 60
90 60
12. Construct AVL Search tree by inserting following elements in order of
their occurrence 6, 5, 4, 3, 2, 1
1 2 3 4
Insert 6 Insert : 5 Insert : 4 Insert : 3
Right
6 6 6 5 5
F F Rotate 6 F
F F
: 5 : 5 : 4 i i
6 4 6
\ F \ F \ : n n
F : F
D : D 4 : D \ a a
: 3 \ :
F \ F F \ F D l l
\ : D \
S D S : D S F M D M
6\ 5 \ F D
\ F \ F \ S a a
F S
S D D D D Insert : 2F
D Insert : S1 \ t S F \ t S
F \ F 5 F \ F 5 D e e
\ S D 5 \
D S F S D S F F r Righ
S D F Fr
t \ D
F F 3F i 6\ F F 3 i S 6 i i
F D S 6F
i S : i n FD S i : n F F a Rotate 4 a
S F F n FS
n 2 F \ n a4 :F F n 2 \ a4 i : l
F 3S i al :F
a : i D a l: \S i a : D l: n \ F
i n lF
l M l \ M :F \i
l 1 \ n FRight \ DF n F \ a D : n a M: n
M aD M D aD l F \ 2 \i D
M : D a SRotate 5 Fi a S a Dn l a\ Fa
\ a tF a F tF M S D :
a \ Fl Sn l \ l Fa M tD Sl
eS a \ F \
t D S M D3t eS \a M t S D M Sl a eF \M
D
e F \ a FF e r\ Dl a e \ F r\ t D S
a \M t rS Da
F
r S D2t Si r iD FM t r D S iD e F \
t a e i\ Ft
5 aF r S D S D
i \ F: e Fni aF Sa e i F F e Ft r aD Se
: \
a D S\r i a a lS Ft r a S i lS i F F
r Se i lF Fr
1 \ D
l F: FDi n4l l FF i6e i l F n FF a i S
i a FS
: D :i l n F F Fr i
F S i Fa aMF :i nFr a F i a a i l :F na
\ F S
: F nSl l\a : \n a:i l : n l \n F a i
l F \i
D D \ SD F na al
\ i a\F M t a l\a F \ a M D
a : l n F : Dn lF
Assignment: F \ i al
D n l D: aFeD Fl MDl : D l a Fl \ M a
: \ Fa
S D lF
n Construct M:
Define
F a height S F binary
MF\ of tthe
r
F
SM atree. Define
\ F M balanced
height t SM tree
D awithl its advantages. a height
Sl
\ binary F\ tree) \ a M: D a\
balanced
S l e\i S (AVL
aSD tree a tS: for the S a datae42,06,54,62,88,50,22,32,12,33
D following \a F t M
D F \M
D theF AVLDsearch S tree\ by inserting \the following elements a\ tD
Construct
\ M tF ra \ D t e F t r D
t S e inathe order ofltheir occurrence. 64,
Da 1,
F tD S eF
44,
D 26,
F 13, 110, F D85 FF
S 98,
i rD S D e i Fe \ r t M
t
aS e i l e S eF \ F rS
S i a
F t rn\ aF F Sr iF \ F r a Sr D i e
\ rS D Se i\
F F n t
S e i aD l : S Fi aS D S i l Fi F a r
D i\ F Fr aD
i i a e
F r al F F\ F ia lF\ F F a F ia S l i
F aD S i lF
n n l r
i ia l MS : Di n l FiD S i l : n
l F F a S lF F na FS
a M i
n a FaF \F n aF :nF F n F \ aF i : l
F i al :F
l l a al a FS
a : i D : \aS i a : D l: n \
l
V1 V4
V1 V2 V3 V4
V1 0 1 0 1 V2
1 0 0 0 V3
1 1 0 1 V4
0 1 00
V2 V3
We can extend the idea of matrix representation to multigraph and weighted graphs. In the case of
multigraph or weighted graph we write aji = w, where aij denotes either the multiplicity or the
weight of the edge.
Path matrix
An entry of 1 in the ith row and jth column of A shows the existence of an edge (v i, vj), that is a path
of length 1 from vi to vj.
( )
Let denote the elements of A2 by aij(2). Then {∑
(2)
Therefore aij is equal to the number of different paths of exactly length 2 from vi to vj.
Similarly element in ith row and jth column of A3 gives number of paths of exactly length 3 from vi to
v j.
1 1 000 1 1 01 1 2 01
2
A = 1 011 3
A = 1 1 00 4
A = 1 1 01
2 01 2 2 0 1 0 2 3 0 2 1
1 1 00 1 01 1 00
16. Which are the basic traversing techniques of the Graph? Write the
algorithm of them.
Most graph problems involve traversal of a graph. Traversal of a graph means visit each node exactly
once.
Two commonly used graphs traversal techniques are
1. Depth First Search (DFS)
2. Breadth First Search (BFS)
Depth First Search (DFS)
It is like preorder traversal of tree.
Traversal can start from any vertex vi
Vi is visited and then all vertices adjacent to vi are traversed recursively using DFS
1
DFS (G, 1) is given by
a) Visit (1)
2 5
3 4 b) DFS (G, 2)
DFS (G, 3)
DFS (G, 4)
6 7 DFS (G, 5)
Since graph can have cycles, we must avoid re-visiting a node. To do this when we visit a vertex V,
we marks it visited as visited should not be selected for traversal.
Procedure : DFS (vertecx V)
This procedure traverse the graph G in DFS manner. V is a starting vertex to be explored. S is a
Stack, visited[] is an array which tells you whether particular vertex is visited or not. W is a adjacent
node of vertex V. PUSH and POP are functions to insert and remove from stack respectively.
2 5
3 4
BFS traversal of given graph is:
1 | 2, 3, 4, 5 | 6, 7 | 8
6 7
8
Procedure : BFS (Vertex V)
This procedure traverse the graph G in BFS manner. V is a starting vertex to be explored. Q is a
queue, visited[] is an array which tells you whether particular vertex is visited or not. W is a adjacent
node of vertex V.
1. Initialize Q
2. [Marks visited of V as 1]
visited [v] 1
3. [Add vertex v to Q]
InsertQueue(V)
4. [Repeat while Q is not empty]
Repeat while Q is not empty
v RemoveFromQueue()
For all vertices W adjacent to v
if visited[w] is 0
then visited[w] 1
InsertQueue(w)
A Spanning tree of a graph is an undirected tree consisting of only those edges necessary to connect all
the nodes in the original graph
A spanning tree has the properties that
o For any pair of nodes there exists only one path between them
o Insertion of any edge to a spanning tree forms a unique cycle
The particular Spanning for a graph depends on the criteria used to generate it.
If DFS search is use, those edges traversed by the algorithm forms the edges of tree, referred to as
Depth First Spanning Tree.
If BFS Search is used, the spanning tree is formed from those edges traversed during the search,
producing Breadth First Search Spanning tree.
V0
V1 V2
V3 V4 V5 V6
V7
V0
V0
V1 V2
V1 V2
V3 V4 V5 V6
V3 V4 V5 V6
V7
V7
Consider the graph shown in Fig Find depth-first and breadth first
traversals of this graph starting at A
B C
E
D
F
A A
B C B C
E E
D D
F F
DFS : A B D C F E BFS : A B C D F E
Define spanning tree and minimum spanning tree. Find the minimum
spanning tree of the graph shown in Fig.
A 5
4
3 E
B Using Prim’s Algorithm:
6
2 5 6 7 Let X be the set of nodes explored, initially X = { A }
C D
1
Step 1: Taking minimum weight edge of all Adjacent Step 2: Taking minimum weight edge of all Adjacent A–B|4
edges of X = { A } edges of X = { A , B }
A–E|5
A–C|6
4
A 4
A
A–D|6
B–E|3
B X={A,B}
B B–C|2
X={A,B,C} C–E|6
2
C–D|1
C D–E|7
Step 3: Taking minimum weight edge of all Adjacent Step 4: Taking minimum weight edge of all Adjacent
edges of X = { A , B , C } edges of X = { A , B , C , D }
4
A 4
A
3
B B E
X = { A , B , C, D }
2 2
C 1 D C 1
D
X = { A , B , C, D, E }
All nodes of graph are there with set X, so we obtained minimum spanning tree of cost: 4 + 2 + 1 + 3 = 10
A 5
4
3
B E
Using Kruskal’s Algorithm
6
2 5 6 7
C D
1
Step 1: Taking min edge (C,D) Step 2: Taking next min edge (B,C) Step 3: Taking next min edge (B,E)
3
B B E
2 2
C 1
D
C 1 D C 1 D
Step 4: Taking next min edge (A,B) Step 5: Taking next min edge (A,E) it forms cycle so do not consider
Step 6: Taking next min edge (C,E) it forms cycle so do not consider
4
A Step 7: Taking next min edge (A,D) it forms cycle so do not consider
Step 8: Taking next min edge (A,C) it forms cycle so do not consider
3 Step 9: Taking next min edge (E,D) it forms cycle so do not consider
B E
All edges of graph has been visited,
2
so we obtained minimum spanning tree of cost:
C D 4 + 2 + 1 + 3 = 10
1
Give example and applications of directed and undirected graphs. Find the
adjacency matrix for the graph shown in Fig.
Applications of graph:
Electronic Circuits
o Printed Circuit Board
o Integrated Circuit
Transportation networks
o Highway networks
Modeling a road network with vertexes as towns and edge costs as distances.
o Water Supply networks
Modeling a water supply network. A cost might relate to current or a function of capacity and
length. As water flows in only 1 direction, from higher to lower pressure connections or
downhill, such a network is inherently an acyclic directed graph.
o Flight network
Minimizing the cost and time taken for air travel when direct flights don't exist between starting
ending
and
irports.
Computer networks
o Local Area Network
o Internet
Dynamically modeling the status of a set of routes by which traffic might be directed over the
Internet.
o Web
Using a directed graph to map the links between pages within a website and to analyze ease of
navigation between different parts of the site.
Databases
o Entity Relationship Diagram