Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

3 Types of Cloud Computing£1.50

Programming language£2.50

Total£4.00

Title: mcs-021 2nd sem
Description: Course Code : MCS-021 Course Title : Data and File Structures Assignment Number : BCA (III)/021/Assignment/ 2016

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


BCA & MCA (IGNOU)
http://www
...
com

Course Code
Course Title

: MCS-021

: Data and File Structures

Assignment Number : BCA (III)/021/Assignment/ 2016
April, 2016 (For January 2016 Session)
1
...
(20 Marks)

void del_front()
{
int a;
if(q
...
front;
printf("\n\deleted number is =%d at position %d",q
...
front==q
...
front=q
...
front=q
...
h>
#define max 10 //macro definition
struct queue
// Define a structure having an array and two variable front and rear
{
int arr[max];
int front, rear;
}q;
void init()
// initialize queue’s front and rear position
{
q
...
rear=-1;
}
void add_front(int n) // add and element into the linked list
{
if (q
...
front--;
q
...
front]=n;
if(q
...
front=0;
}
}

1

Ans:

BCA & MCA (IGNOU)
http://www
...
com

void add_rear(int n)
// add and element into the linked list
{
if (q
...
rear=q
...
arr[q
...
rear==-1)
q
...
front;i<=q
...
arr[i]);
}
main()
{
int ch,n;
char c;

2

void del_rear()
{
int a;
if(q
...
front;
printf("\n\deleted number is =%d ",q
...
front==q
...
front=q
...
rear=q
...
Implement multiple queues in a single dimensional array
...
(20 Marks)
Ans:
Multiqueue is a data structure where multiple queues are maintained
...
We may use one dimensional array or multidimensional array to
represent a multiple queue
...
ignouassignmentguru
...
ignouassignmentguru
...
h>
#define max 10 //macro definition
struct queue

// Define a structure having an array and two variable front and rear

{
int arr[max];
int front, rear;
}q;
void init()

// initialize queue’s front and rear position

{
q
...
rear=-1;
}
void add_front(int n)

// add and element into the linked list

{

{
printf("Element can not be inserted at front");
return;
}
else
{
q
...
arr[q
...
front==-1)

/ignouassignmentfree

IGNOU ASSIGNMENT GURU Page-

4

if (q
...
ignouassignmentguru
...
front=0;
}
}

void del_front()
{
int a;
if(q
...
front;
printf("\n\deleted number is =%d at position %d",q
...
front==q
...
front=q
...
front=q
...
front==max-1)
{
printf("Element can not be inserted at rear");
return;
}
else
{
q
...
rear+1;

/ignouassignmentfree

IGNOU ASSIGNMENT GURU Page-

void add_rear(int n)

BCA & MCA (IGNOU)
http://www
...
com

q
...
rear]=n;
if(q
...
rear=0;
}
}

void del_rear()
{
int a;
if(q
...
front;
printf("\n\deleted number is =%d ",q
...
front==q
...
front=q
...
rear=q
...
ignouassignmentguru
...
front;i<=q
...
arr[i]);
}
main()
{
int ch,n;
char c;

init();
clrscr();
do
{
printf("\n1-add front\n");
printf("2-add rear\n");
printf("3-delete front\n");
printf("4-delete rear\n");
printf("5-display rear\n");
printf("6- Exit\n");
printf("\n\n enter the choice");

7

scanf("%d",&ch);
IGNOU ASSIGNMENT GURU Page-

switch(ch)
{
case 1:
printf("\nenter the number");
scanf("%d",&n);
add_front(n);
break;
case 2:
printf("\nenter the number");

/ignouassignmentfree

BCA & MCA (IGNOU)
http://www
...
com

scanf("%d",&n);
add_rear(n);
break;
case 3:
del_front();
break;
case 4:
del_rear();
break;
case 5:
disp();
break;
case 6:
break;
default:
printf("sorry wrong choice");
}
printf("\nD you want to continue(y/n)");
c=getche();
}while(c=='y');

}

3
...

Refer to various journals and other online resources
...

(20 Marks)
Ans:Do yourself [this is latest research; you can search easily in Google]

4
...
ignouassignmentguru
...
So, it is
also called AVL tree
...
A tree is called unbalanced if balance factor of any node in tree become other than 1, 0 or -1
...
Balance factor is written on the head
node
...

Every leaf is black
...

Every path from a given node down to any descendant leaf contains the same number of
black nodes
...

The root of the tree is black
...
The
insertion and deletion operations, along with the tree rearrangement and recoloring, are
also performed in O(log

n) time

9



AVL trees are always at the optimal balance point, but can slow down inserts and deletes
because they never allow that tree height to be outside the -1 to 1 range
...

AVL trees are often compared with red-black trees because both support the same set of
operations and take O(log n) time for the basic operations
...

The balancing of the tree is not perfect but it is good enough to allow it to guarantee

IGNOU ASSIGNMENT GURU Page-



/ignouassignmentfree


Title: mcs-021 2nd sem
Description: Course Code : MCS-021 Course Title : Data and File Structures Assignment Number : BCA (III)/021/Assignment/ 2016