Download as pdf or txt
Download as pdf or txt
You are on page 1of 90

REG NO:61781921110045

EX NO:1(a)
IMPLEMENTATION OF BINARY TREE TRAVERSALS -
PREORDER TRAVERSAL
DATE:14.09.2022

AIM:

To write a program for the following scenario,

Complete the preorder function in the editor below, which has 1 parameter: a pointer to the root
of a binary tree. It must print the values in the tree's preorder traversal as a single line of space-
separated values

*Input Format
Our test code passes the root node of a binary tree to the preorder function.
*Constraints
1 <= Nodes in the tree <=500
*Output Format
Print the tree's preorder traversal as a single line of space-separated values
*Sample Input
1
\
2
\
5
/ \
3 6
\
4

*Sample Output

125346

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |1


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

return node;

else

struct node* cur;

if(data <= root->data)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |2


REG NO:61781921110045

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

void preOrder(struct node *root)

if(root==NULL)

return root;

else

printf("%d ",root->data);

preOrder(root->left);

preOrder(root->right);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |3


REG NO:61781921110045

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

preOrder(root);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |4


REG NO:61781921110045

OUTPUT 1:

OUTPUT 2:

RESULT:

The program to find the preorder of the binary tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |5


REG NO:61781921110045

EX NO:1(b)
IMPLEMENTATION OF BINARY TREE TRAVERSALS –
INORDER TRAVERSAL
DATE:14.09.2022

AIM:

To write a program for the following scenario,

Complete theinorder function in your editor below, which has 1 parameter: a pointer to the root
of a binary tree. It must print the values in the tree's inorder traversal as a single line ofspace-
separated values.

*Input Format
Our hidden tester code passes the root node of a binary tree to your inorder function
*Constraints
1 <= Nodes in the tree <=500
*Output Format
Print the tree's inorder traversal as a single line of space-separated values.
*Sample Input
1
\
2
\
5
/ \
3 6
\
4

*Sample Output
123456

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |6


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

return node;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |7


REG NO:61781921110045

else

struct node* cur;

if(data <= root->data)

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

void inOrder( struct node *root)

if(root==NULL)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |8


REG NO:61781921110045

return root;

else

inOrder(root->left);

printf("%d ",root->data);

inOrder(root->right);

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0){

scanf("%d", &data);

root = insert(root, data);

inOrder(root);

return 0;}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 Page |9


REG NO:61781921110045

OUTPUT 1:

OUTPUT 2:

RESULT:

The program to find the inorder of the binary tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 10


REG NO:61781921110045

EX NO:1(c)
IMPLEMENTATION OF BINARY TREE TRAVERSALS –
POSTORDER TRAVERSAL
DATE:14.09.2022

AIM:

To write a program for the following scenario,

Complete the postorder function in your editor below, which has 1 parameter: a pointer to the
root of a binary tree. It must print the values in the tree's postorder traversal as a single line of
space-separated values.

*Input Format
Our hidden tester code passes the root node of a binary tree to your postorder function
*Constraints
1 <= Nodes in the tree <=500
*Output Format
Print the tree's postorder traversal as a single line of space-separated values.
*Sample Input
1
\
2
\
5
/ \
3 6
\
4
*Sample Output
436521

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 11


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

return node;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 12


REG NO:61781921110045

else

struct node* cur;

if(data <= root->data)

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

void postOrder( struct node *root)

if(root==NULL)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 13


REG NO:61781921110045

return root;

else

postOrder(root->left);

postOrder(root->right);

printf("%d ",root->data);

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 14


REG NO:61781921110045

postOrder(root);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 15


REG NO:61781921110045

OUTPUT 1:

OUTPUT 2:

RESULT:

The program to find the postorder of the binary tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 16


REG NO:61781921110045

EX NO:1(d)
IMPLEMENTATION OF BINARY TREE TRAVERSALS –
HEIGHT OF A BINARY TREE
DATE:14.09.2022

AIM:

To write a program for the following scenario,

Complete the getHeight or height function in the editor. It must return the height of a binary tree
as an integer.

getHeight or height has the following parameter(s):

root: a reference to the root of a binary tree.

Note -The Height of binary tree with single node is taken as zero.

*Input Format
The first line contains an integer n, the number of nodes in the tree.
Next line contains n space-separated integer where 𝑖 𝑡ℎ integer denotes node[i].data.
*Constraints
1<=nodedata[i]<=20
1<=n<=20
*Output Format

Your function should return a single integer denoting the height of the binary tree.

*Sample Input

*Sample Output
3

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 17


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 18


REG NO:61781921110045

return node;

else

struct node* cur;

if(data <= root->data)

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

int getHeight(struct node* root)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 19


REG NO:61781921110045

if(root==NULL)

return -1;

else

int lht=getHeight(root->left);

int rht=getHeight(root->right);

if(lht>rht)

return (lht+1);

else

return (rht+1);

int main()

struct node* root = NULL;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 20


REG NO:61781921110045

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

printf("%d",getHeight(root));

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 21


REG NO:61781921110045

OUTPUT 1:

OUTPUT 2:

RESULT

The program to find the height of the binary tree is compiled and executed successfully

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 22


REG NO:61781921110045

EX NO:1(e)
IMPLEMENTATION OF BINARY TREE TRAVERSALS –
LEVEL ORDER TRAVERSAL
DATE:14.09.2022

AIM:

To write a program for the following scenario,

Given a pointer to the root of a binary tree, you need to print the level order traversal of this tree.
In level-order traversal, nodes are visited level by level from left to right. Complete the function
level-order and print the values in a single line separated by a space.

*Input Format

You are given a function,

void levelOrder(Node * root) {

}
*Constraints
1<=Nodes in the tree <=500
*Output Format
Print the values in a single line separated by a space.
*Sample Input
1
\
2
\
5
/ \
3 6
\
4
*Sample Output

125364

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 23


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

return node;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 24


REG NO:61781921110045

else

struct node* cur;

if(data <= root->data)

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

int getHeight(struct node *root)

if(root==NULL)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 25


REG NO:61781921110045

return 0;

else

int lht=getHeight(root->left);

int rht=getHeight(root->right);

if(lht>=rht)

return(lht+1);

else

return(rht+1);

void currentlvl(struct node *root,int lvl)

if(root==NULL)

return ;

if(lvl==1)

printf("%d ",root->data);

else if(lvl>1)

currentlvl(root->left,lvl-1);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 26


REG NO:61781921110045

currentlvl(root->right,lvl-1);

void levelOrder(struct node *root)

int h=getHeight(root);

int i;

for(i=1;i<=h;i++)

currentlvl(root,i);

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 27


REG NO:61781921110045

levelOrder(root);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 28


REG NO:61781921110045

OUTPUT :

RESULT:

The program to print the level-order of the binary tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 29


REG NO:61781921110045

EX NO:2(a)
IMPLEMENTATION OF BINARY SEARCH TREE –
INSERTION ON BINARY SEARCH TREE
DATE:21.09.2022

AIM:

To write a program for the following scenario,

You are given a pointer to the root of a binary search tree and values to be inserted into the tree.
Insert the values into their appropriate position in the binary search tree and return the root of the
updated binary tree. You just have to complete the function.

*Input Format
You are given a function,
Node * insert (Node * root ,int data) {
}
*Constraints

No. of nodes in the tree <=500

*Output Format

Return the root of the binary search tree after inserting the value into the tree.

*Sample Input
4
/\
2 7
/\
1 3
The value to be inserted is 6
*Sample Output
4
/ \
2 7
/\ /
1 36

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 30


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

void preOrder( struct node *root)

if( root == NULL )

return;

printf("%d ",root->data);

preOrder(root->left);

preOrder(root->right);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 31


REG NO:61781921110045

struct node* insert( struct node* root, int data )

if(root==NULL)

struct node *root;

root=(struct node* )malloc(sizeof(struct node));

root->data=data;

root->left=NULL;

root->right=NULL;

return root;

else

struct node *cur;

if(data<root->data)

cur=insert(root->left,data);

root->left=cur;

else

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 32


REG NO:61781921110045

cur=insert(root->right,data);

root->right=cur;

return root;

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

preOrder(root);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 33


REG NO:61781921110045

OUTPUT:

RESULT:

The program to insert the values in binary search tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 34


REG NO:61781921110045

EX NO:2(b)
IMPLEMENTATION OF BINARY SEARCH TREE –
LOWEST COMMON ANCESTORS
DATE:21.09.2022

AIM:

You are given pointer to the root of the binary search tree and two values V1 and V2. You need
to return the lowest common ancestor (LCA) of V1 and V2 in the binary search tree

In the diagram above, the lowest common ancestor of the nodes 4 and 6 is the node 3.Node 3 is
the lowest node which has nodes 4 and 6 as descendants.

*Function Description
Complete the function lca in the editor below. It should return a pointer to the lowest common
ancestor node of the two values given.

lca has the following parameters:


- root: a pointer to the root node of a binary search tree
- v1: a node.data value
- v2: a node.data value

*Input Format

The first line contains an integer, n, the number of nodes in the tree.
The second line contains n space-separated integers representing node.data values.
The third line contains two space-separated integers, V1 and V2.

To use the test data, you will have to create the binary search tree yourself. Here on the platform,
the tree will be created for you

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 35


REG NO:61781921110045

*Constraints

1<= n, node. data <= 25

1 <= V1, V2 <= 25

V1!= V2

The tree will contain nodes with data equal to V1 and V2

*Output Format

Return the a pointer to the node that is the lowest common ancestor of V1 and V2.

Sample Input
6
423176
17

V1=1 and V2=7.

Sample Output

[reference to node 4]

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 36


REG NO:61781921110045

PROGRAM:

#include <stdio.h>

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

struct node* insert( struct node* root, int data )

if(root == NULL)

struct node* node = (struct node*)malloc(sizeof(struct node));

node->data = data;

node->left = NULL;

node->right = NULL;

return node;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 37


REG NO:61781921110045

else

struct node* cur;

if(data <= root->data)

cur = insert(root->left, data);

root->left = cur;

else

cur = insert(root->right, data);

root->right = cur;

return root;

struct node *lca( struct node *root, int v1, int v2 ) {

while(root!= NULL)

if(v1 > root->data && v2 > root->data)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 38


REG NO:61781921110045

root = root->right;

else if(v1 < root->data && v2 < root->data)

root = root ->left;

else

break;

return root;

int main()

struct node* root = NULL;

int t;

int data;

scanf("%d", &t);

while(t-- > 0)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 39


REG NO:61781921110045

scanf("%d", &data);

root = insert(root, data);

int v1;

int v2;

scanf("%d%d", &v1, &v2);

struct node *ans = lca(root, v1, v2);

printf("%d", ans->data);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 40


REG NO:61781921110045

OUTPUT:

RESULT:

The program to find the lowest common ancestors of the nodes are compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 41


REG NO:61781921110045

EX NO:2(c)
IMPLEMENTATION OF BINARY SEARCH TREE –
DELETION ON BINARY SEARCH TREE
DATE:21.09.2022

AIM:

To write a program for the following scenario,

Given a root node reference of a BST and a key, delete the node with the given key in the BST.
Return the root node reference (possibly updated) of the BST.

Basically, the deletion can be divided into two stages:

Search for a node to remove. If the node is found, delete the node.

*Input Format

First line gets the number of elements in BST

Next line enter the elements one by one

Enter key to delete

*Constraints

The number of nodes in the tree is in the range [0, 104]. -105 <= Node->val <= 105 Each node
has a unique value. root is a valid binary search tree. -105 <= key <= 105

*Output Format

Return the root of the binary search tree after inserting the value into the tree.

*Sample Input
6
536247
3

*Sample Output
54267

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 42


REG NO:61781921110045

PROGRAM:

#include <string.h>

#include <math.h>

#include <stdlib.h>

struct node

int data;

struct node *left;

struct node *right;

};

void preOrder( struct node *root)

if( root == NULL )

return 0;

else{

printf("%d ",root->data);

preOrder(root->left);

preOrder(root->right);

struct node* insert( struct node* root, int data )

if (!root)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 43


REG NO:61781921110045

struct node* n=(struct node*) malloc(sizeof(struct node));

n->data=data;

n->left=NULL;

n->right=NULL;

root=n;

return root;

if (data > root->data) {

root->right = insert( root->right,data);

else {

root->left = insert( root->left,data);

return root;

struct node* minValueNode(struct node* node)

struct node* current = node;

while (current && current->left != NULL)

current = current->left;

return current;

struct node* deleteNode(struct node* root, int key)

if (root == NULL)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 44


REG NO:61781921110045

return root;

if (key < root->data)

root->left = deleteNode(root->left, key);

else if (key > root->data)

root->right = deleteNode(root->right, key);

else {

if (root->left == NULL)

struct node* temp = root->right;

free(root);

return temp;

else if (root->right == NULL)

struct node* temp = root->left;

free(root);

return temp;

struct node* temp = minValueNode(root->right);

root->data= temp->data;

root->right = deleteNode(root->right, temp->data);

return root;

int main()

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 45


REG NO:61781921110045

struct node* root = NULL;

int t;

int data,key;

scanf("%d", &t);

while(t-- > 0)

scanf("%d", &data);

root = insert(root, data);

scanf("%d",&key);

deleteNode(root,key);

preOrder(root);

return 0;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 46


REG NO:61781921110045

OUTPUT:

RESULT:

The program to delete a node from the binary search tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 47


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF EXPRESSION TREE
DATE:

AIM:

To implement the expression tree using C program.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
struct tree
{
char data;
struct tree *left;
struct tree *right;
};

int top=-1;
struct tree *stack[20];

void operand(char a)
{
struct tree *n=(struct tree*)malloc(sizeof(struct tree));
n->data=a;
n->right=NULL;
n->left=NULL;
push(n);
}

struct tree* pop()


{
return stack[top--];
}

void operator1(char a)
{
struct tree *n1=(struct tree*)malloc(sizeof(struct tree));
n1->data=a;
n1->right=pop();
n1->left=pop();
push(n1);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 48


REG NO:61781921110045

void push(struct tree *n)


{
stack[++top]=n;
}

void inorder(struct tree *temp)


{
if(temp!=NULL)
{
inorder(temp->left);
printf("%c",temp->data);
inorder(temp->right);
}
}

void main()
{
int i;
char s[20];
printf("Enter postfix expression:");
//scanf("%s",&s);
gets(s);
for(i=0;s[i]!='\0';i++)
{
if(s[i]=='+' || s[i]=='-' || s[i]=='*' || s[i]=='/')
operator1(s[i]);
else
operand(s[i]);
}
inorder(stack[top]);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 49


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement a Expression Tree is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 50


REG NO:61781921110045

EX NO:
MAX-HEAP IMPLEMENTATION USING PRIORITY QUEUE
DATE:

AIM:

Program to Implement max-heap using priority queue.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
int size = 0;
void swap(int *a, int *b) {
int temp = *b;
*b = *a;
*a = temp;
}

void heapify(int array[], int size, int i)


{
if (size == 1)
{
printf("Single element in the heap");
}
else
{
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < size && array[l] > array[largest])
largest = l;
if (r < size && array[r] > array[largest])
largest = r;

if (largest != i)
{
swap(&array[i], &array[largest]);
heapify(array, size, largest);
}
}
}

void insert(int array[], int newNum)


{

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 51


REG NO:61781921110045

if (size == 0)
{
array[0] = newNum;
size += 1;
}
else
{
array[size] = newNum;
size += 1;
for (int i = size / 2 - 1; i >= 0; i--)
{
heapify(array, size, i);
}
}
}

void deleteRoot(int array[], int num)


{
int i;
for (i = 0; i < size; i++)
{
if (num == array[i])
break;
}
swap(&array[i], &array[size - 1]);
size -= 1;
for (int i = size / 2 - 1; i >= 0; i--)
{
heapify(array, size, i);
}
}

void printArray(int array[], int size)


{
for (int i = 0; i < size; ++i)
printf("%d ", array[i]);
printf("\n");
}

int main()
{
int array[10];
int n,x,i;
printf("Enter the number of elements:");
scanf("%d",&n);
printf("Enter the elements:");

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 52


REG NO:61781921110045

for(i=0;i<n;i++)
{
scanf("%d",&x);
insert(array,x);
}
printf("Max-Heap array: ");
printArray(array, size);

deleteRoot(array,array[0]); //since max-heap deletion occurs only at zeroth index.

printf("After deleting an element: ");


printArray(array, size);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 53


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement a Priority Queue is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 54


REG NO:61781921110045

EX NO:
MIN-HEAP IMPLEMENTATION USING PRIORITY QUEUE
DATE:

AIM:

Program to Implement min-heap using priority queue.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
int size = 0;
void swap(int *a, int *b) {
int temp = *b;
*b = *a;
*a = temp;
}

void heapify(int array[], int size, int i)


{
if (size == 1)
{
printf("Single element in the heap");
}
else
{
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < size && array[l] < array[largest])
largest = l;
if (r < size && array[r] < array[largest])
largest = r;

if (largest != i)
{
swap(&array[i], &array[largest]);
heapify(array, size, largest);
}
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 55


REG NO:61781921110045

void insert(int array[], int newNum)


{
if (size == 0)
{
array[0] = newNum;
size += 1;
}
else
{
array[size] = newNum;
size += 1;
for (int i = size / 2 - 1; i >= 0; i--)
{
heapify(array, size, i);
}
}
}

void deleteRoot(int array[], int num)


{
int i;
for (i = 0; i < size; i++)
{
if (num == array[i])
break;
}
swap(&array[i], &array[size - 1]);
size -= 1;
for (int i = size / 2 - 1; i >= 0; i--)
{
heapify(array, size, i);
}
}

void printArray(int array[], int size)


{
for (int i = 0; i < size; ++i)
printf("%d ", array[i]);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 56


REG NO:61781921110045

printf("\n");
}

int main()
{
int array[10];
int n,x,i;
printf("Enter the number of elements:");
scanf("%d",&n);
printf("Enter the elements:");
for(i=0;i<n;i++)
{
scanf("%d",&x);
insert(array,x);
}
printf("Min-Heap array: ");
printArray(array, size);

deleteRoot(array,array[0]); //since min-heap deletion occurs only at zeroth index.

printf("After deleting an element: ");


printArray(array, size);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 57


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement a Priority Queue is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 58


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF AVL TREE
DATE:

AIM:

To implement the AVL Tree using C program.

PROGRAM:

#include <stdio.h>
#include <stdlib.h>

// Create Node
struct Node {
int key;
struct Node *left;
struct Node *right;
int height;
};
int max(int a, int b);
// Calculate height
int height(struct Node *N) {
if (N == NULL)
return 0;
return N->height;
}

int max(int a, int b) {


return (a > b) ? a : b;
}

// Create a node
struct Node *newNode(int key) {
struct Node *node = (struct Node *)
malloc(sizeof(struct Node));
node->key = key;
node->left = NULL;
node->right = NULL;
node->height = 1;
return (node);
}

// Right rotate
struct Node *rightRotate(struct Node *y) {

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 59


REG NO:61781921110045

struct Node *x = y->left;


struct Node *T2 = x->right;

x->right = y;
y->left = T2;

y->height = max(height(y->left), height(y->right)) + 1;


x->height = max(height(x->left), height(x->right)) + 1;

return x;
}

// Left rotate
struct Node *leftRotate(struct Node *x) {
struct Node *y = x->right;
struct Node *T2 = y->left;

y->left = x;
x->right = T2;

x->height = max(height(x->left), height(x->right)) + 1;


y->height = max(height(y->left), height(y->right)) + 1;

return y;
}

// Get the balance factor


int getBalance(struct Node *N) {
if (N == NULL)
return 0;
return height(N->left) - height(N->right);
}

// Insert node
struct Node *insertNode(struct Node *node, int key) {
// Find the correct position to insertNode the node and insertNode it
if (node == NULL)
return (newNode(key));

if (key < node->key)


node->left = insertNode(node->left, key);
else if (key > node->key)
node->right = insertNode(node->right, key);
else
return node;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 60


REG NO:61781921110045

// Update the balance factor of each node and


// Balance the tree
node->height = 1 + max(height(node->left),
height(node->right));

int balance = getBalance(node);


if (balance > 1 && key < node->left->key)
return rightRotate(node);

if (balance < -1 && key > node->right->key)


return leftRotate(node);

if (balance > 1 && key > node->left->key) {


node->left = leftRotate(node->left);
return rightRotate(node);
}

if (balance < -1 && key < node->right->key) {


node->right = rightRotate(node->right);
return leftRotate(node);
}

return node;
}

struct Node *minValueNode(struct Node *node) {


struct Node *current = node;

while (current->left != NULL)


current = current->left;

return current;
}

// Delete a nodes
struct Node *deleteNode(struct Node *root, int key) {
// Find the node and delete it
if (root == NULL)
return root;

if (key < root->key)


root->left = deleteNode(root->left, key);

else if (key > root->key)


root->right = deleteNode(root->right, key);

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 61


REG NO:61781921110045

else {
if ((root->left == NULL) || (root->right == NULL)) {
struct Node *temp = root->left ? root->left : root->right;

if (temp == NULL) {
temp = root;
root = NULL;
} else
*root = *temp;
free(temp);
} else {
struct Node *temp = minValueNode(root->right);

root->key = temp->key;

root->right = deleteNode(root->right, temp->key);


}
}

if (root == NULL)
return root;

// Update the balance factor of each node and


// balance the tree
root->height = 1 + max(height(root->left),
height(root->right));

int balance = getBalance(root);


if (balance > 1 && getBalance(root->left) >= 0)
return rightRotate(root);

if (balance > 1 && getBalance(root->left) < 0) {


root->left = leftRotate(root->left);
return rightRotate(root);
}

if (balance < -1 && getBalance(root->right) <= 0)


return leftRotate(root);

if (balance < -1 && getBalance(root->right) > 0) {


root->right = rightRotate(root->right);
return leftRotate(root);
}

return root;
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 62


REG NO:61781921110045

// Print the tree


void printPreOrder(struct Node *root) {
if (root != NULL) {
printf("%d ", root->key);
printPreOrder(root->left);
printPreOrder(root->right);
}
}

int main()
{
struct Node *root = NULL,x;
for(int i=0;i<n;i++)
{
Scanf(“%d”,&x);
Root=insertNode(root,x);
}

printPreOrder(root);

root = deleteNode(root, 3);

printf("\nAfter deletion: ");


printPreOrder(root);

return 0;
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 63


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement AVL Tree insertion and deletion is compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 64


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF HASHING-LINEAR PROBING
DATE:

AIM:

To implement the hashing using linear probing in C program.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
int main()
{
int m,n,i;
printf("Enter the Table size:");
scanf("%d",&m);
printf("Enter the number of elements less than or equal to %d:",m);
scanf("%d",&n);
int keys[n];
printf("Enter the elements:");
for(i=0;i<n;i++)
{
scanf("%d",&keys[i]);
}
int table[m],prob[m];
for (i=0;i<m;i++)
{
table[i]=0;
prob[i]=0;
}
int size_of_key=sizeof(keys)/sizeof(keys[0]);
for (i=0;i<size_of_key;i++)
{
int factor=keys[i]%m;
int fact=1;
int inc=0;
int p=1;
while(fact)
{
int f=(factor+inc)%m;
if (table[f]==0)
{
table[f]=keys[i];
prob[f]=p;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 65


REG NO:61781921110045

fact=0;
}
else
{
inc++;
p++;
}
}
}
printf("Index\tKey\tProbing\n");
for (i=0;i<m;i++)
{
printf("%d\t%d\t%d\n",i,table[i],prob[i]);
}
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 66


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement hashing using linear probing is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 67


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF HASHING-QUADRATIC PROBING
DATE:

AIM:

To implement the hashing using quadratic probing in C program.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
int main()
{
int m,n,i;
printf("Enter the Table size:");
scanf("%d",&m);
printf("Enter the number of elements less than or equal to %d:",m);
scanf("%d",&n);
int keys[n];
printf("Enter the elements:");
for(i=0;i<n;i++)
{
scanf("%d",&keys[i]);
}
int table[m],prob[m];
for (int i=0;i<m;i++)
{
table[i]=0;
prob[i]=0;
}
int size_of_key=sizeof(keys)/sizeof(keys[0]);
for (int i=0;i<size_of_key;i++)
{
int factor=keys[i]%m;
int fact=1;
int inc=0;
int p=1;
while(fact)
{
int f=(factor+(inc*inc))%m;
if (table[f]==0)
{
table[f]=keys[i];
prob[f]=p;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 68


REG NO:61781921110045

fact=0;
}
else
inc++;
p++;
}

}
printf("Index\tKey\tProbing\n");
for (int i=0;i<m;i++)
{
printf("%d\t%d\t%d\n",i,table[i],prob[i]);
}
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 69


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement hashing using quadratic probing is compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 70


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF HASHING-SEPARATE CHAINING
DATE:

AIM:

To implement the hashing using separate chaining in C program.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>

struct node
{
int data;
struct node *next;
};

void init(int size,struct node *chain[])


{
int i;
for(i = 0; i < size; i++)
chain[i] = NULL;
}
void insert(int value,int size,struct node *chain[])
{
//create a newnode with value
struct node *newNode = malloc(sizeof(struct node));
newNode->data = value;
newNode->next = NULL;
//calculate hash key
int key = value % size;
//check if chain[key] is empty
if(chain[key] == NULL)
chain[key] = newNode;
//collision
else
{
//add the node at the end of chain[key].
struct node *temp = chain[key];
while(temp->next)
{
temp = temp->next;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 71


REG NO:61781921110045

temp->next = newNode;
}
}

void print(int size,struct node *chain[])


{
int i;
for(i = 0; i < size; i++)
{
struct node *temp = chain[i];
printf("Index[%d]-->",i);
while(temp)
{
printf("%d -->",temp->data);
temp = temp->next;
}
printf("NULL\n");
}
}

void main()
{
int key,m,n,i;
printf("Enter the Table size:");
scanf("%d",&m);
struct node *chain[m];
//init array of list to NULL
init(m,chain);
printf("Enter the number of elements less than or equal to %d:",m);
scanf("%d",&n,chain);
printf("Enter the elements:");
for(i=0;i<n;i++)
{
scanf("%d",&key);
insert(key,m,chain);
}
print(m,chain);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 72


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement hashing using separate chaining is compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 73


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF GRAPH TRAVERSAL - DEPTH FIRST SEARCH
DATE:

AIM:

To implement the graph traversal using depth first search in C program.

PROGRAM:

#include<stdio.h>

void DFS(int);
int G[10][10],visited[10],n; //n is no of vertices and graph is sorted in array G[10][10]
void main()
{
int i,j;
printf("Enter number of vertices:");

scanf("%d",&n);
//read the adjecency matrix
printf("\nEnter adjecency matrix of the graph:");

for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&G[i][j]);
//visited is initialized to zero
for(i=0;i<n;i++)
visited[i]=0;
DFS(0);
}
void DFS(int i)
{
int j;
printf("\n%d",i);
visited[i]=1;
for(j=0;j<n;j++)
if(!visited[j]&&G[i][j]==1)
DFS(j);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 74


REG NO:61781921110045

OUTPUT:

RESULT:
The program to implement graph traversal using breath first search is compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 75


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF GRAPH TRAVERSAL – BREATH FIRST SEARCH
DATE:

AIM:

To implement the graph traversal using depth first search in C program.

PROGRAM:

#include <stdio.h>

int n, i, j, visited[10], queue[10], front = -1, rear = -1;


int adj[10][10];

void bfs(int v)
{
for (i = 1; i <= n; i++)
if (adj[v][i] && !visited[i])
queue[++rear] = i;
if (front <= rear)
{
visited[queue[front]] = 1;
bfs(queue[front++]);
}
}

void main()
{
int v;
printf("Enter the number of vertices: ");
scanf("%d", &n);
for (i = 1; i <= n; i++)
{
queue[i] = 0;
visited[i] = 0;
}
printf("Enter graph data in matrix form: \n");
for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
scanf("%d", &adj[i][j]);
printf("Enter the starting vertex: ");
scanf("%d", &v);
bfs(v);
printf("The node which are reachable are: \n");
for (i = 1; i <= n; i++)

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 76


REG NO:61781921110045

if (visited[i])
printf("%d\t", i);
else
printf("BFS is not possible. Not all nodes are reachable");
return 0;
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 77


REG NO:61781921110045

OUTPUT:

RESULT:
The program to implement graph traversal using depth first search is compiled and executed
successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 78


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF KRUSKAL’S ALGORITHM
DATE:

AIM:

Program to implement the Kruskal’s algorithm.

PROGRAM:

#include<stdio.h>
#include<stdlib.h>
int i,j,k,a,b,u,v,n,ne=1;
int min,mincost=0,cost[9][9],parent[9];
int find(int);
int uni(int,int);
void main()
{
printf("\n\tImplementation of Kruskal's algorithm\n");
printf("\nEnter the no. of vertices:");
scanf("%d",&n);
printf("\nEnter the cost adjacency matrix:\n");
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)

scanf("%d",&cost[i][j]);
if(cost[i][j]==0)
cost[i][j]=999;
}
}
printf("The edges of Minimum Cost Spanning Tree are\n");
while(ne < n)
{
for(i=1,min=999;i<=n;i++)
{
for(j=1;j <= n;j++)
{
if(cost[i][j] < min)
{
min=cost[i][j];
a=u=i;
b=v=j;
}
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 79


REG NO:61781921110045

}
u=find(u);
v=find(v);
if(uni(u,v))
{
printf("%d edge (%d,%d) =%d\n",ne++,a,b,min);
mincost +=min;
}
cost[a][b]=cost[b][a]=999;
}
printf("\n\tMinimum cost = %d\n",mincost);
}
int find(int i)
{
while(parent[i])
i=parent[i];
return i;
}
int uni(int i,int j)
{
if(i!=j)
{
parent[j]=i;
return 1;
}
return 0;
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 80


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement Kruskal’s algorithm is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 81


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF FLOYD-WARSHALL ALGORITHM
DATE:

AIM:

Program to implement Floyd-Warshall algorithm.

PROGRAM:

#include <stdio.h>
#define INF 99999
int V;
void main()
{
printf("Enter the number of vertices:");
scanf("%d",&V);
int i,j,k,graph[V][V];
printf("ENTER THE COST FOR THE GRAPH");
printf("\nIF THERE IS NO PATH ENTER 9999:\n");
for (int i=0;i<V;i++){
for(int j=0;j<V;j++){
scanf("%d",&graph[i][j]);
}
}
for (k = 0; k < V; k++) {
for (i = 0; i < V; i++) {
for (j = 0; j < V; j++) {
if (graph[i][k] + graph[k][j] < graph[i][j])
graph[i][j] = graph[i][k] + graph[k][j];
}
}
}
printf("The following matrix shows the shortest distances between every pair of vertices \n");
for (int i = 0; i < V; i++) {
for (int j = 0; j < V; j++) {
if (graph[i][j] == INF)
printf("\tINF");
else
printf("\t%d",graph[i][j]);
}
printf("\n");
}
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 82


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement Floyd-Warshall algorithm is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 83


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF MERGE SORT
DATE:

AIM:

Program to implement a Merge sort

PROGRAM:

#include <stdio.h>

// Merge two subarrays L and M into arr


void merge(int arr[], int p, int q, int r)
{
// Create L ← A[p..q] and M ← A[q+1..r]
int n1 = q - p + 1;
int n2 = r - q;
int L[n1], M[n2];

for (int i = 0; i < n1; i++)


L[i] = arr[p + i];
for (int j = 0; j < n2; j++)
M[j] = arr[q + 1 + j];

// Maintain current index of sub-arrays and main array


int i, j, k;
i = 0;
j = 0;
k = p;

// Until we reach either end of either L or M, pick larger among


// elements L and M and place them in the correct position at A[p..r]
while (i < n1 && j < n2)
{
if (L[i] <= M[j])
{
arr[k] = L[i];
i++;
}
else

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 84


REG NO:61781921110045

{
arr[k] = M[j];
j++;
}
k++;
}

// When we run out of elements in either L or M,


// pick up the remaining elements and put in A[p..r]
while (i < n1)
{
arr[k] = L[i];
i++;
k++;
}

while (j < n2)


{
arr[k] = M[j];
j++;
k++;
}
}

// Divide the array into two subarrays, sort them and merge them
void mergeSort(int arr[], int l, int r)
{
if (l < r)
{
// m is the point where the array is divided into two subarrays
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);

// Merge the sorted subarrays


merge(arr, l, m, r);
}
}

// Print the array

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 85


REG NO:61781921110045

void printArray(int arr[], int size)


{
for (int i = 0; i < size; i++)
printf("%d ", arr[i]);
printf("\n");
}

// Driver program
int main()
{
int n,i;
printf("Enter the number of elements:");
scanf("%d",&n);
int arr[n];
printf("Enter the %d elements:",n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}

int size = sizeof(arr) / sizeof(arr[0]);

mergeSort(arr, 0, size - 1);


printf("Sorted array: \n");
printArray(arr, size);
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 86


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement Merge sort is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 87


REG NO:61781921110045

EX NO:
IMPLEMENTATION OF QUICK SORT
DATE:

AIM:

Program to implement a Quick sort

PROGRAM:

#include<stdio.h>
void quicksort(int number[25],int first,int last)
{
int i, j, pivot, temp;
if(first<last)
{
pivot=first;
i=first;
j=last;
while(i<j)
{
while(number[i]<=number[pivot]&&i<last)
i++;
while(number[j]>number[pivot])
j--;

if(i<j)
{
temp=number[i];
number[i]=number[j];
number[j]=temp;

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 88


REG NO:61781921110045

}
}
temp=number[pivot];
number[pivot]=number[j];
number[j]=temp;

quicksort(number,first,j-1);
quicksort(number,j+1,last);

}
}

int main()
{
int i, count, number[25];
printf("Enter some elements (Max. - 25): ");
scanf("%d",&count);
printf("Enter %d elements: ", count);
for(i=0;i<count;i++)
scanf("%d",&number[i]);
quicksort(number,0,count-1);
printf("The Sorted Order is: ");
for(i=0;i<count;i++)
printf(" %d",number[i]);

return 0;
}

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 89


REG NO:61781921110045

OUTPUT:

RESULT:

The program to implement Quick sort is compiled and executed successfully.

U19ADS305 – DATA STRUCTURES AND ALGORITHMS LABORATORY 2 P a g e | 90

You might also like