Data Structures & Its Application-2
Data Structures & Its Application-2
Data Structures & Its Application-2
APPLICATION – 21CS34
&
DATA STRUCTURES –
21AR32
INTRODUCTION
INTRODUCTION TO DATA STRUCTURES
What is a Data?
• The quantities, characters or symbols
• On which operations are performed by a computer
• Which may be
• stored
• transmitted in the form of electrical signals
• Recorded on magnetic, optical or mechanical recorded media
• Example: a = b + c
INTRODUCTION TO DATA STRUCTURES
• Data & Information:
• Data: SERUTCURTS ATAD
• Information: DATA STRUCTURES
• Graphs are used to store the friendship information on a social networking site
CLASSIFICATION
CLASSIFICATIONS
CLASSIFICATIONS
• Primitive Data Structure:
PUSH() POP()
CLASSIFICATIONS
• Linked List: Group of nodes in a sequence which has 2 parts: data and address
CLASSIFICATIONS
• Queue: First In First Out (FIFO) to process data
CLASSIFICATIONS
• Queue: First In First Out (FIFO) to process data
CLASSIFICATIONS
Tree: Elements stored on hierarchical relation among data
CLASSIFICATIONS
• Tree:
CLASSIFICATIONS
• Graph: Define connection between different types of data / nodes
DATA STRUCTURE
OPERATIONS
DATA STRUCTURE OPERATIONS
• Traversing: Accessing each record exactly once so that items in the record may
be processes.
• Searching: Finding the location of the record with a given key value or finding
the locations of all records which satisfy one or more conditions.
• Inserting: Adding new record to the data structure.
• Deleting: Removing a record from the data structure.
• Sorting: Arranging the records in some logical order.
• Merging: Combining the records in two different sorted files into a single sorted
file
DYNAMICALLY ALLOCATED
ARRAYS
DYNAMICALLY ALLOCATED ARRAYS
• There are four dynamic memory allocation function:
1. Malloc
2. Calloc
3. Realloc
4. Free
• Malloc:
• Malloc function allocates memory and leaves the allocated memory uninitialized.
• Allocated memory can only be accessed through pointers
• Malloc returns the pointer of type void which can be casting into pointer of any form.
• Malloc returns null pointer if the memory cannot be allocated.
• Syntax:
• void * malloc(size) //actual syntax
• p = (cast type*)malloc(size) //in general
• int *p;
p = (int *)malloc(size)
DYNAMICALLY ALLOCATED ARRAYS
• Malloc:
#include<stdio.h>
#include<stdlib.h>
void main()
{
int n;
printf(“Enter the size of array”);
scanf(“%d”,&n);
int *a = (int *)malloc(n*sizeof(int));
for(i=0;i<n;i++)
{
a[i] = i+1;
}
for(int i=0;i<n;i++)
{
printf(“%d”,a[i]);
}
}
DYNAMICALLY ALLOCATED ARRAYS
• calloc:
• Calloc allocates the memory and initializes all bytes to zero
• Syntax: void* calloc(n, size) //general syntax
datatype *p;
p = (casttype*)calloc(n,sizeof(datatype));
#include<stdio.h>
#include<stdlib.h>
void main()
{
int n;
printf(“Enter the size of array”);
scanf(“%d”,&n);
int *a = (int *)calloc(n,sizeof(int));
for(i=0;i<n;i++)
{
a[i] = i+1;
}
for(int i=0;i<n;i++)
{
printf(“%d”,a[i]);
}
}
DYNAMICALLY ALLOCATED ARRAYS
• realloc:
• If memory allocated using malloc and calloc function is insufficient or more than the required, then we can reallocate the memory using realloc function.
SparseMatrix Transpose(a)::=
return the matrix produced by interchanging the
row and column value of every triple.
DEMONSTRATION OF SPARSE MATRIX WITH ARRAYS
Abstract Data Type of Sparse Matrix:
• ADT SparseMatrix is
objects: a set of triples <row, column, value>, where row and column are integers
and form a unique combination, and value comes from the set item.
functions:
for all a, b € SparseMatrix, x € item, i, j, maxCol, maxRow € index
1 6 0 0 0 0 4 0 5
• Solution:
Fast transpose approach make use of two additional arrays
1. Row Count array – stores the count of number of elements in each row
2. Starting Position array – Indicates the starting index of each row
STRING OPERATIONS
STRINGS
Strings - Introduction:
• A string is a sequence of characters.
• It includes digits and special characters.
• The number of characters in the string is called length of the string.
• The string with zero characters is empty string or null string.
STRINGS
Storing Strings:
• Strings are stored in three types of structures:
1. Record Oriented Fixed – length structures
2. Variable – length structures
3. Linked Structures
STRINGS
1. Record Oriented Fixed Length Structure:
• In this structure, each line will be stored as a fixed length record.
• Disadvantage:
• Time is wasted reading an entire record if most of the storage consists of blank space
• Certain records may require more space than available.
• When the correction consists of more or fewer characters than the original text, changing
a misspelled word require the entire record to be changed.
• Example: printf(“Data”);
int i; p r i n t f ( “ D a t a “ ) ;
0 15
i n t i ;
16 31
STRINGS
2. Variable Length Storage with Fixed Maximum:
• The storage of variable length strings in memory with fixed length can be done
in two ways
1. One can use a marker such as $$ to signal the end of the string
2. One can list the length of the string as an additional item in the pointer array.
Printf(“Data”);$$ 15 Printf(“Data”);$$
int i;$$ 6 int i;$$
. .
. .
STRINGS
3. Linked Storage:
• Fixed length storages cannot be used for word processing which requires
frequent modifications of the strings, for such applications strings are stored by
means of linked lists.
• Linked list is a linearly ordered sequence of memory cell called nodes.
• Each node contains an item and a link which points to the next node in the list.
• Strings can be stored in linked lists as follows:
• Each memory cell is assigned 1 character or a fixed number of characters.
• Link contained in all nodes gives the address of cell containing the next
character or group of characters.
h a i fo ll ow
Linked storage - 1 character per word Linked storage - 2 character per word
STRINGS
String Operations:
• Substring: Group of consecutive elements in string are called as substrings.
• Accessing a substring from a given string requires
1. Name of the string or the string itself
2. Position of the first character of the substring in the given string
3. Length of substring or position of the last character of the string.
4. Substring operation can be written as: SUBSTRING(string, initial, length)
STRINGS
String Operations:
• Indexing: Also called as pattern matching, refers to finding the position when a
string pattern P first appears in a given string text T
• It can be written as index( text, pattern)
• Concatenation: Let S1 and S2 be strings. Then concatenation of S1 and S2
results in a string which contains characters from S1 followed by characters in S2
• Length: The number of characters in a string is called its length.
STRINGS Reverse string
Return: i – length(Pattern)
STRINGS
Pattern matching using Table derived from pattern:
• Algorithm:
Step 1: [initialization] Set i=0 and state=q0
Step 2: Repeat steps 3 to 5 while Si ≠P, i<N
Step 3: Read T[i]
Step 4: Set Si+1=F(Si,Ti)
Step 5: Set i=i+1
[end of Step 2 loop]
Step 6: [Successful?]
if Si=p then,
index = i-length(P)+1
else
index=0
[end if]
STRINGS
Pattern Matching by Checking End Indices First:
• Algorithm: Pattern Matching
Step 1: Find length of pattern
Step 2: Take a pointer end_match and set it to the length of pattern – 1
Step 3: Take a pointer start, which points to the beginning of text
If the last character of pattern and character at index end_match of T matches
the begin comparing from first index till all characters match
Or
End of string
if the last character did not match
then increment start pointer
STACK CONCEPT /
INTRODUCTION TO STACK
STACK CONCEPT
Introduction:
• Stack is an ordered list in which insertions (also called as push) and deletions (also called as
pop) are made at one end called top.
• Stack is LIFO structure i.e., Last In First Out.
• It is very useful data structure in C programming
• Stack can be implemented using Linked List or Array
• When stack is empty, then it does not contain any
element inside it.
• Whenever the stack is empty, the position of top is -1.
ARRAY REPRESENTATION
OF STACK
STACK IMPLEMENTATION
Using One Dimensional Array:
stack [ max_stack_size]
max_stack_size: maximum number of entries in the stack.
stack[0] = 1st or bottom element is stored
stack[i-1] = ith element is stored
top = points to the top element in stack
top – 1 = empty stack.
STACK CONCEPT
ADT of stack:
Objects: A finite list with zero or more elements
Functions:
Stack Creates(maxstacksize) :: create an empty stack, whose maximum size = maxstacksize.
Boolean IsFull(stack,maxstacksize) :: if(number of element in stack == maxstacksize)
return true
else return false
Stack push(stack,item) :: if(IsFull(stack))
stackFull
else insert item into top of stack & return
Boolean IsEmpty(stack) :: IsEmpty(stack)
if(stack = =creates(maxstacksize))
return true
else return false
int fun(int n)
{
if(n==1)
return 1;
else
return 1 + fun(n-1)
}
RECURSION
• Whenever a function is called, its activation record is maintained inside a stack.
int fun(int n)
{
if(n==1)
return 1;
else
return 1 + fun(n-1)
}
Int main()
{
int n = 3;
printf(“%d”, fun(n));
return 0;
}
ACKERMAN FUNCTION
ACKERMANN FUNCTION
• It is a function of two integers m & n
• If m = 0,
then A(m, n) = n+1
• If m ≠ 0 but n = 0,
then A(m, n) = A(m-1, 1)
• If m ≠ 0 and n ≠ 0,
then A(m, n) = A(m-1, A(m, n-1))
B. Describe the structure if, after the preceding insertions, three elements are deleted.
APPLICATION OF QUEUE
Application of Queue – JOB SCHEDULING
• Job Scheduling in computer programming makes use of queue
• Show the queue (sequential queue) for scheduling of the jobs as given below:
• J1, J2, J3 arrive in order…Job J4 arrives after J1 is completed
Stack 2
Stack 1
top[0] = bottom[0] = -1
for(j = 1; j < n; j++)
top[j] = bottom[j] = (max_size/n)*j;
bottom[n] = max_size – 1;
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
• Assume max_size = 15
Let no. of stacks = 3
Initialize top[0] = bottom [0] = -1
Top[1] = bottom [1] = 15/3 *1 = 5
top[2] = bottom[2] = 15/3 *2 = 10
if top = bottom, stack = empty
Multiple Stacks & Queues
• Before inserting an element, increment top by 1.
• In this case, top[0] = 4. i.e., top of stack 0 = 4
• Increment top [0] by 1.
• That is, top[0] = 5 & bottom[1] = 5
• If top[i] = bottom[i+1] if top[i] = bottom[i]
then stack i is full then stack is empty
• Top[0] = bottom[1] = > stack[0] is full
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 2 3 4 5
• Assume max_size = 15
Let no. of stacks = 3
Initialize top[0] = bottom [0] = 1
Top[1] = bottom [1] = 15/3 *1 = 5
top[2] = bottom[2] = 15/3 *2 = 10
INTRODUCTION TO LINKED
LISTS
INTRODUCTION TO LINKED LISTS
• List : Linear collection of data items
• 2 Ways to maintain a list in memory:
• Arrays
• Linked List
• Linked lists are a way to store data.
• Linked list is a linear collection of data elements called node,
where the linear order is given by means of pointers.
• A linked list is a list made up of nodes that consists of two parts
• Data : This field is used to store data/information
• Link : This field contains the address of the next node in the list
INTRODUCTION TO LINKED LISTS
• Types of Linked List
• Singly Linked List
• Doubly Linked List NULL
• Circular Linked List
typedef struct node *NODE //typecasting the structure into one variable called NODE. NODE contains DATA,
LINK
struct node {
int data;
struct node *link;
};
int main()
{
struct node *head = NULL;
head = (struct node *) malloc(sizeof(struct node));
head->data = 45;
head ->link = NULL;
printf(“%d”, head->data);
return 0;
}
OUTPUT: 45
TRAVERSING A LINKED LIST
TRAVERSING A LINKED LIST
• Traversing is the most common operation that is performed in almost every scenario of
singly linked list.
• Traversing is visiting each node of the list once in order to perform some operation on that.
• ptr = head;
while (ptr ! = NULL)
{
ptr = ptr -> link;
}
TRAVERSING A LINKED LIST
• Let LIST be a linked list in memory. This algorithm traverses LIST, applying an operation
PROCESS to each element of LIST. The variable PTR points to the node currently being
processed.
1. Set NUM := 0
2. Set PTR := START
C program to count the number of elements
3. Repeat Steps 4 & 5 while PTR ≠ NULL
4. Set NUM : = NUM + 1
5. Set PTR := LINK[PTR]
end of step 3
5. Return
INSERTION OF NODE
INSERTING A NODE AT THE END OF LINKED LIST
INSERTING A NODE AT THE END OF LINKED LIST
void insert_end()
{
NODE temp,ptr;
temp = create();
if(head = = NULL)
{
head = temp;
}
ptr = head;
while(ptr!=NULL)
{
ptr = ptr -> link;
}
ptr->link=temp;
}
INSERTING A NODE AT THE FRONT OF LINKED LIST
INSERTING A NODE AT THE FRONT OF LINKED LIST
void insert_afterkey()
{
int key;
printf(“Enter the key:\n”);
scanf(“%d”, &key);
NODE temp = create(), NODE cur = first;
if(first = = NULL)
{
printf(“List empty”);
return;
}
while(cur -> data !=key)
{
cur = cur -> link;
}
temp -> link = cur - > link;
cur -> link = temp;
}
DELETION OF NODE
DELETING A NODE FROM THE FRONT OF LINKED LIST
void delete_front()
{
NODE temp;
if(first = = NULL)
{
printf(“The list is empty\n”);
return;
}
temp = first;
first = first ->link;
temp->link = NULL;
free(temp);
temp = NULL;
}
DELETING A NODE FROM THE END OF LINKED LIST
void delete_end()
{
NODE temp, prev= NULL;
if(first = = NULL)
{
printf(“The list is empty\n”);
return;
}
if(first ->link = = NULL)
{
free(first);
first = NULL;
return;
}
temp = first;
while(temp -> link ! = NULL)
{
prev = temp;
temp = temp - > link;
}
prev -> link = NULL;
free(temp);
temp = NULL;
}
DISPLAY ELEMENTS OF
NODE
DISPLAY ELEMENTS OF LINKED LIST
void display()
{
if(first = = NULL)
{
printf(“The list is empty\n”);
return;
}
NODE temp;
temp = first;
while(temp ! = NULL)
{
printf(“%d”, temp - > data);
temp = temp - > link;
}
}
Design, Develop and Implement a menu driven Program in C for the following
operations on
Singly Linked List (SLL) of Student Data with the fields: USN, Name, Branch,
Sem, PhNo.
a. Create a SLL of N Students Data by using front insertion.
b. Display the status of SLL and count the number of nodes in it
c. Perform Insertion / Deletion at End of SLL
d. Perform Insertion / Deletion at Front of SLL(Demonstration of stack)
e. Exit
//header file
#include<stdio.h>
#include<stdlib.h>
printf("Enter Name:");
scanf("%s",temp->name);
printf("Enter Branch:");
scanf("%s",temp->branch);
printf("Enter Phone
Number:");
scanf("%s",temp->phno);
printf("Enter Semester:");
scanf("%d",& temp->sem);
}
printf("%s\t%s\t%s\t%s\t%d\n",temp->usn,temp-
>name,temp->branch,temp->phno,temp-
>sem);
temp=temp->link;
}
count++;
printf("%s\t%s\t%s\t%s\t%d\n",temp->usn,temp-
>name,temp->branch,temp->phno,temp-
>sem);
printf("\n Student count:%d\n",count);
}
return;
}
//main Function
void main()
{
int choice;
while(1)
{
printf(" MENU
\n"); printf("1. Create a SLL of N
Students using front insertion\n"); printf("2. Display from Beginning\
n");
printf("3. Insert at front\n");
printf("4. Insert at end\n");
printf("5. Delete at front\n");
printf("6. Delete at end\n");
printf("7. Exit\n");
printf("
void search()
{
int key, flag = 0;
printf(“Enter the key”);
scanf(“%d”, &key);
NODE cur = first;
while(cur ! = NULL && flag = = 0)
{
if(cur -> data = =key)
{
flag = 1;
}
else
{
cur = cur - > link;
}
}
if (flag = = 1)
{
printf(“key found”);
}
else
{
printf(“Key not found”);
}
}
SEARCHING A LINKED LIST - SORTED
• START is a pointer variable which contains the address of first node. ITEM is the value to be
searched
1. set PTR = START, LOC = 1 // initialize PTR & LOC
2. Repeat step 3 while PTR != NULL
3. If ITEM < INFO[PTR], then
Set PTR = LINK[PTR]
Else if ITEM = INFO[PTR], then
Set LOC = PTR & Exit
Else
Set LOC = NULL, & Exit
End of IF
End of Loop
4. Set LOC= NULL
5. EXIT
SEARCHING A LINKED LIST - SORTED
• Void search()
{
int key, flag = 0;
printf(“ enter key”);
scanf(“%d”, &key);
NODE cur = first;
while(cur!=NULL && flag = =0)
{
if (cur -> data = = key)
{
flag = 1;
}
else if( cur->data > key)
{
break;
}
else
{
cur = cur -> link;
}
}
if (flag = =1) { printf(“key found”);}
else { printf(“Key not found”);}
}
INSERT AFTER KEY IN A
LINKED LIST
Void insert afterkey()
{
NODE NODE
• DEGREE OF A NODE:
• The number of Subtrees of a node / Total number
of children of that node
• DEGREE OF A TREE:
• The maximum of the degree of the
nodes in the tree
TERMINOLOGY
• TERMINAL NODE/LEAF:
• Nodes that have degree zero / node with no successor / elements(node) with no children.
=4
= + 1 =4+1=5.
Therefore, total number of leaf
node = 5
REPRESENTATION OF
BINARY TREES
ARRAY REPRESENTATION
LINKED REPRESENTATION
• The problems in array representation are:
It is good for complete binary trees, but more memory is wasted for
skewed and many other binary trees.
The insertion and deletion of nodes from the middle of a tree require the
movement of many nodes to reflect the change in level number of these nodes.
• These problems can be easily overcome by linked representation.
• Each node has three fields,
LeftChild - which contains the address of left subtree
RightChild - which contains the address of right subtree.
Data - which contains the actual information
LINKED REPRESENTATION
• Each node has three fields,
LeftChild - which contains the address of left subtree
RightChild - which contains the address of right subtree.
Data - which contains the actual information
• Structure:
struct node
{
int data;
struct node *left;
struct node *right;
};
typedef struct node *treepointer;
LINKED REPRESENTATION
LINKED REPRESENTATION
BINARY TREE TRAVERSALS
BINARY TREE TRAVERSALS
• Traversing the tree or visiting each node in the tree exactly once
• Types:Pre Order
In Order
Post Order
PREORDER TREE TRAVERSALS
• Preorder is the procedure of visiting a node, traversing left and continue. When you
cannot continue, move right and begin again or move back until you can move right and
resume.
• Recursive function:
Visit the root
Traverse the left subtree in preorder
Traverse the right subtree in preorder
• void preorder (treepointerptr)
{
if (ptr)
{
printf (“%d”,ptr→data);
preorder (ptr→leftchild);
preorder (ptr→rightchild);
}
INORDER TRAVERSAL
• Inorder traversal calls for moving down the tree towards the left until you cannot go
further. Then visit the node, move one node to the right and continue. If no move can
be done, then go back one more node.
• Recursive function:
Traverse the left subtree in inorder
Visit the root
Traverse the right subtree in inorder
• void inorder (treepointerptr)
{
if (ptr)
{
iorder (ptr→leftchild);
printf (“%d”,ptr→data)
inorder (ptr→rightchild);
}
INORDER TRAVERSAL
• void inorder (treepointerptr)
{
if (ptr)
{
iorder (ptr→leftchild);
printf (“%d”,ptr→data)
inorder (ptr→rightchild);
}
}
INORDER TRAVERSAL
• Edge:
• Undirected Edge
• Directed Edge
• Weighted Edge
TERMINOLOGIES
• Undirected Graph :
A graph with only undirected edges is said to be undirected graph
• Directed Graph:
A graph with only directed edges is said to be directed graph.
• Mixed Graph:
A graph with both undirected and directed edges is said to be mixed
graph.
TERMINOLOGIES
• End vertices or Endpoints:
The two vertices joined by edge are called end vertices (or endpoints) of
that edge.
• Origin:
If a edge is directed, its first endpoint is said to be the origin of it.
• Destination:
If a edge is directed, its first endpoint is said to be the origin of it and
the other endpoint is said to be the destination of that edge.
• Adjacent:
If there is an edge between vertices A and B then both A and B are said
to be adjacent
TERMINOLOGIES
• Outgoing Edge:
A directed edge is said to be outgoing edge on its origin vertex.
• Incoming Edge:
A directed edge is said to be incoming edge on its destination vertex.
• Degree:
Total number of edges connected to a vertex is said to be degree of that
vertex.
• Indegree:
Total number of incoming edges connected to a vertex is said to be
indegree of that vertex.
• Outdegree:
Total number of outgoing edges connected to a vertex is said to be
outdegree of that vertex.
TERMINOLOGIES
• Parallel edges or Multiple edges:
If there are two undirected edges with same end vertices and two
directed edges with same origin and destination, such edges are called parallel
edges or multiple edges.
• Self-loop:
Edge (undirected or directed) is a self-loop if its two endpoints coincide
with each other.
TERMINOLOGIES
• Simple Graph:
A graph is said to be simple if there are no parallel and self loop edges.
• Path:
A path can be defined as the sequence of nodes that are followed in
order to reach some terminal node V from the initial node U.
TERMINOLOGIES
• Closed Path:
A path will be called as closed path if the initial node is same as terminal
node. A path will be closed path if V(origin)=V(Terminal).
• Complete Graph:
A complete graph is the one in which every node is connected with all
other nodes. A complete graph contain n(n-1)/2 edges where n is the number
of nodes in the graph.
•.
TERMINOLOGIES
• Digraph:
A digraph is a directed graph in which each edge of the graph is
associated with some direction and the traversing can be done only in the
specified direction.
GRAPH REPRESENTATIONS
REPRESENTATIONS
• By Graph representation, we simply mean the technique which is to be used in
order to store graph into the computer's memory.
1. Sequential/Matrix Representation
2. Linked Representation
MATRIX REPRESENTATION
• Sequential representation:
In sequential representation, adjacency matrix is used to store the mapping
represented by vertices and edges.
In adjacency matrix, the rows and columns are represented by the graph
vertices.
A graph having n vertices, will have a dimension n x n.
An entry Mij in the adjacency matrix representation of an undirected graph G
will be 1 if there exists an edge between Vi and Vj
MATRIX REPRESENTATION
• Sequential representation:
MATRIX REPRESENTATION
• Sequential representation:
MATRIX REPRESENTATION
• Representation of weighted directed graph is different.
• Instead of filling the entry by 1, the Non- zero entries of the adjacency matrix
are represented by the weight of respective edges.
LIST REPRESENTATION
• Linked Representation
In the linked representation, an adjacency list is used to store the Graph into
the computer's memory.
An adjacency list is maintained for each node present in the graph which stores
the node value and a pointer to the next adjacent node to the respective node.
If all the adjacent nodes are traversed then store the NULL in the pointer field
of last node of the list.
The sum of the lengths of adjacency lists is equal to the twice of the number of
edges present in an undirected graph.
LIST REPRESENTATION
• Linked Representation
In a directed graph, the sum of lengths of all the adjacency lists is equal to the
number of edges present in the graph.
LIST REPRESENTATION
• Linked Representation
In weighted directed graph, each node contains an extra field that is called the
weight of the node.
The adjacency list representation of a directed graph is:
ELEMENTARY GRAPH
OPERATIONS
TRAVERSAL METHODS –
BREADTH FIRST SEARCH
DEPTH FIRST SEARCH
GRAPH TRAVERSAL
• Traversing the graph means examining all the nodes and vertices of the graph.
• There are two standard methods:
1. Breadth First Search
2. Depth First Search
DEPTH FIRST SEARCH - DFS
• Depth first search (DFS) algorithm starts with the initial node of the graph G
and then goes to deeper and deeper until we find the goal node or the node
which has no children.
• The algorithm then backtracks from the dead end towards the most recent
node that is yet to be completely unexplored.
• The data structure used in DFS is stack.
DFS
• DFS:
• Function
BFS
• BFS:
• BFS is a graph traversal algorithm that starts traversing the graph from root
node and explores all the neighboring nodes.
• Then, it selects the nearest node and explore all the unexplored nodes.
• BFS traversal of a graph produces a spanning tree as final result.
• Spanning Tree is a graph without loops.
• Queue data structure with maximum size of total number of vertices in the
graph is used to implement BFS traversal.
BFS
• BFS:
BFS
• BFS:
• Function
INSERTION SORT
INSERTION SORT
INSERTION SORT
INSERTION SORT
INSERTION SORT
INSERTION SORT
INSERTION SORT
RADIX SORT
RADIX SORT
RADIX SORT
RADIX SORT
RADIX SORT
ADDRESS CALCULATION
SORT
HASHING
INTRODUCTION
HASH TABLE ORGANIZATIONS
HASHING FUNCTIONS
STATIC AND DYNAMIC HASHING