Search This Blog

Sunday, October 9, 2011

MCS-021 Assignments Solution January-2012:-Question 4: Briefly, describe various file organizations.(20 marks)


 File organisation may be defined as a method of storing records in file. Also, the
subsequent implications on the way these records can be accessed. The following are the factors
involved in selecting a particular file organisation:
Ease of retrieval
Convenience of updates
Economy of storage

MCS-021 Assignments Solution January-2012: Question 2: Write an algorithm for the conversion of a Tree into a Binary Tree. Also, write the corresponding program.(20 marks)


Algorithm for the implementation of a Binary tree:
Step-1: If value of new element < current element, then go to step-2 or else step -3
Step-2: If the current element does not have a left sub-tree, then make new element the left child of
the current element; else make the existing left child as current element and go to step-1
Step-3: If the current element does not have a right sub-tree, then make new element the right child of
the current element; else make the existing right child as current element and go to step-1
The process of converting the general tree to a binary tree is as follows:

MCS-021 Assignments Solution January-2012:-Question 1Write a program for multiplication of two polynomials. Use Doubly Linked lists. (20 marks)


struct d_list{
int coeff;
int exp;
struct d_list *left;
struct d_list *right;
};
typedef struct d_list poly;
void poly_create(poly*);