Delivered by FeedBurner

New Answers in your Inbox

Difference- Singly and Doubly Linked Circullar List [CS62 june 2001]

Queastion: 2(b) List the difference between a Singly Linked Circular List and Doubly Linked Circular List. List the advantages of each list.

Answer: In single linked circular list one cannot traverse a list backward, nor can a node be deleted from a circularly linked list, given only a pointer to that node. Whereas in double linked list each node in such a list contains two pointers, one to its predecessores and another its successor. Deleting a given node is possible in double linked list whereas it is not possible in simple linked lists.

Binary Search Tree -CS62 june 2001

Queation: 1.(c): Define binary search tree. Write a function in C to creat a binary search tree.
Answer: A binary search has porperty that all elements in the left subtree of a node n are less than the contents of n and alll elements in the sight subtree of n are greater than or equal to the contents of n.
If a binary search tree is traversed in inorder (left, root, sight) and the contents of each node are printed as the node is visited, the numbers as the node is visited, the numbers are printed in ascending order.
q=null;
p=tree;
while(p!=null){
if (key==k(p))
return(p);
q=p;
if(key
p=left(p);
else
p=right(p);
}
v=maketree(rec,key);
if(q==null)
tree=v;
else
if(key
left(q)=v;
else
right(q)=v;
return(v);

CS62 2001 December 4 (ii) algorithm to implement breadth first search

Question: Write an algorithm / Program to implement breadth first search and also describe the program/algorithm in terms of data structure and its functioning. [CS62, 2001 December, Question 4(ii) ]

Answer:
The algorithm to implement breadth first search is listed below:
Step 1: Initialization of vertices by assigning the vaule 1 to dummy.
Step 2: Place the beginning vertix in Z and set it to halt by assigning 0 to dummy
Step 3: Loop through step 5 until Z becomes NULL.
Step 4: Delete the front vertex of Z. Manipulate the front vertex and set to active state by assigning -1 to dummy.
Step 5: Towards the back of Z, add all the active neighbors of the front vertex y assigning 1 to Dummy, and set them to halt by again assigning 0 to Dummy.
Step 6: Quit

CS62 Jan 2001 3a algorithm of iteractive version of pre-order traversal

Q. Write an algorithm of iteractive version of pre-order traversal.

Ans:
The recursive algorithm of preorder traversing is listed below:
Preorder (Node)

Step1: [Looop through step no. 3]
if Node is not equal to NULL value
Display Inforamtion [Node]
Step2: Make a Call to Preorder(LeftChild [Node])
Step3: Make a Call to Preorder(RightChild [Node])
Step4: Quit

IGNOU MCA Forum

Here is a new forum for IGOU MCA Students to discuss on July 2006 assignment (Old and New Syllabus).Discuss your assignments, questions, problem with hundreds on online students.

Doing Business in India

This post is for those who wants the following information:

  • Business in India,
  • Business opportunities in India,
  • Business schools in India,
  • The Indian business culture.
  • Doing Business in India

Click here for complete information on Doing Business in India

CS-62 JUNE 2003 QNO 6(a)

Q.Write a recursive algorithm to implement Quick Sort.

Ans. The Quick Sort can be implemeted efficiently using recursion. The Base case may be when low is greater than or equal to high.

The function/algo is as follows:

quick(a, low, high)
int a[], low, high
{
if (low>=high)
return;
partition (a, low, high, pos);
quick(a.low, pos-1);
quick(a.pos_1, high);
}

New website for IGNOU BCA MCA student

New website for IGNOU BCA MCA student

MCA-BCA-IGNOU

CS-62 JUNE 2003 QNO 3(c)

3 (c) What is an AVL tree? How does it differ from a Binary Tree?
Answer

A Tree is called AVL tree (Balanced Binary tree) if each node possesses one of the following properties:
(i) A node is called left heavy, if the longest path in its left subtree is one longer then the longest past of its right subtree.
(ii) A node is called right heavy, if the longest part in the right subtree is one longer than the longest path in its left subtree.
(iii) a node is called balanced if the longest paths in both the right and the left subtrees are equal.

Binary tree: A tree is a binary tree if each node of it can have at the most two branches. In other words we can say that if every node of a tree can have at most degree two, then its is called binary tree. In a binary tree left and right subtrees distinguish subtrees of a node.

An AVL tree is a balanced tree, but binary tree can be unbalanced also.

CS-62 JUNE 2003 QNO 3(a)

3(a) Write the postfix form of the following expresstion:
(i) (C X D) ÷ (a-b)
(ii) C X D ÷ a – b

Answer (i) :
cd* ÷ (ab-)
cd*ab-÷

Answer (ii) :
c*da÷- b
cda÷*- b
cda÷*b-

CS-62 JUNE 2003 QNO 3(a)

3(a) Write the postfix form of the following expresstion:
(i) (C X D) ÷ (a-b)
(ii) C X D ÷ a – b

Answer (i) :
cd* ÷ (ab-)
cd*ab-÷

Answer (ii) :
c*da÷- b
cda÷*- b
cda÷*b-

CS-62 JUNE 2003 QNO 2(c)

Question 2.(c) List atleast 4 differences between Arrays and Pointers in 'C' Language.
Answer: (i) Array elemets are always stored in contiguous memory location irrespective of array size.
(ii) There is necessary to assign the size in array, ut not in Pointers.
(iii)Pointers are randomly location.
(iv) The size of the data type which pointer variable refers to is dependent on the data type pointed to by the pointer.
(v) A pointer whenever increameted, points to a location after skipping number of bytes required by the data type.

CS-62 JUNE 2003 QNO 2(b)

Q.2. (b) Consider the tree in the following figure:


Give the Postfix, Prefix and Infix expressions corresponding to the above tree.

Answer:
Infix expression = (a * b) x (c + d ) - e
Prefix expression= *ab* + cd - e = *ab* -+ cde
Postfix expression= (ab *) * (cd + ) -e =ab*cd + * .e -

CS-62 JUNE 2003 QNO 2(a)

QuestionDraw the internal memory representation of the following Binary Tree using Sequential Representation. Assume that nodes appear in the following physical sequence:


A, B, C, D, E, G, F, H


Answer

Index01234567891011
ValueABCDEGFH

CS-62 JUNE 2003 QNO 1(c)

Question: Write a function that takes only a pointer to the root of a binary tree T and computes the number of nodes in T.

Answer: When we traverse a binary tree then all the nodes of tree should traversed. Now if we put a pointer as a counter than it will print the total no of nodes. Any of the traversal schemes can be used to determine the number of elements in abinery tree. But we can use this mechanism also to count the total no. of neds of left subtree and right subtree.
The function is as follows:
int TotalNodes(bnodes*tree)
{
if(tree==(bnode*true)NULL)
return 0;
else
return (TotalNodes(tree->left)+TotalNodes(tree->right)+1);
}

Solved Answer CS62 June 2003 Q.No. 1(a)

Question:
Write a function to multiply two polynomials, using a linked list implementation. You must make sure that the output polynomial is sorted by exponent and has almost one term corresponding to any power. Assume appropriate representation for input polynomials.

Answer:

Void Multiply Polynimal (node*ptr, node*ptr2, node*ptr3)
{
int powe coef;
node*temp, *loc, *tt;
while (ptr1!=(node*)NULL)
{
temp=ptr2;
while(temp!=(node*)NULL)
{
coef=ptr1->coeff*temp->coeff;
powe=ptr1->power+temp->powe;
tt=*ptr3;
loc=search(tt.powe);
if(loc==(node*)NULL)
inser node(sptr3,coef,powe);
else
loc->coef+=coef;
temp=temp->next;
}
ptr1=ptr1->next;}
}
}

BCA MCA Solved assignment, Project

ear IGNOU BCA MCA Students,

Want free solved Assignment, Project, Question paper of all semester.

Visit :
ignoubcamca.com