Friday, December 10, 2010

Data & File Structure DFS 2000


                            Gujarat University
                              MCA Semester II
                          Data & File Structures
                                    
Date: 27th July, 2000
Marks:50

Instructions:
     1.   Write answers of each section in separate answer books.
     2.   Figures to the right of each question indicate marks allocated to
       that question.
     3.   You may make assumptions wherever necessary. Indicate clearly such
       assumptions you have made.

                                 Section I

Q-1  State whether the following statements are TRUE of FALSE:
[8]
     1.   Array is a non-linear data structure.
     2.   Fortran maps a two dimensional array in row-major order.
     3.   A sparse array will have high density of non-zero elements.
     4.   It is impossible to implement recursion without using stack-like data
       structure.
     5.   Stack data structure is used not only for converting the infix
       expression to postfix but also for evaluating the postfix expression.
     6.   A deque is a double-ended queue in which items can be inserted in the
       middle and removed from either end.
     7.   Josephus problem is normally implemented using circular queue.
     8.   A connected graph is a graph that can be partitioned without removing
       any edge.
     9.   Breadth-first traversal of a graph proceeds level-by-level, whereas
       depth-first traversal follows first a path from starting node to an ending
       node, then another path form the start to an end and so forth.
     10.  AVL trees are weight-balanced trees, whereas BB trees are height-
       balanced trees.
     11.  Although quicksort is fastest sorting procedure of all, it performs
       worst for a list which is completely unsorted.
     12.  Mid-square hashing gives better performance than Division-Reminder
       hashing.
     13.  Each node in a trie stores only 10 pointers either null r pointing to
       respective key digits.
     14.  A completely inverted file has an inversion index for every data
       field.
     15.  Red-Black Tree is an m-way search tree where m is always grater than
       4.
     16.  Records can be directly accessed by mapping RECORD KEY in relative
       file.

Q-2 a) Develop an addressing function for a two-dimensional array with
lower and upper bounds AX (L1: U1,
     L2:U2) mapped in row-major order. Name at least three languages which
implement such arrays in
     row-major order.
     Given a two dimensional array Z1(3:10, 10:20) stored in row-major
     order with base address of 200 and size of each element of 4 bytes,
     find address of element Z1(5, 15).                     [5]
        b) Describe Triangular and Sparse arrays. How such arrays get
generated? What are the options for
     mapping of these arrays?
                                    OR
Q-2 a) What is the advantage of converting an arithmetic expression from
infix notation to postfix notation?
     Write the algorithm for conversion of given infix expression using
stack.                   [5]
       b) Convert the following infix expression to prefix and postfix
notations:                    [4]
          1.   (A + B)* D+ E/(F +A*D) +C
          2.   A/B^C+D E-AC
          (The symbol ^ stands for exponential)

Q-3 a) Taking the following set of elements, show step by step hoe
Heapsort procedure will sort the elements
     in required order:
[4]
          20, 52,49,41,17,90,85,32
       b) Name different methods to external sorting. Using Polyphase
sorting, show step by step how the
     following list will be sorted. Assume four tapes/files are available
for sorting:             [4]
          18,30,5,19,8,39,32,26,45,16,11,37,24,3,21,43
                                    OR
Q-3 a) Give diagrammatic representation of GETNODE and FREENODE algorithms
used for management of
     available pool of space.
[4]
       b) Write and explain diagrammatically the algorithm for insertion
of a node in a doubly linked list. [4]
                                Section II
Q-4 a) Write algorithms for pre-order, in-order and post-order traversal
method of a binary tree.      [4]
       b) Sketch a simple binary tree from following data:
[4]
          Parent         Left Child          Right Child
          A(root)             B         C
          B              D         -
          C              E         F
          D              -         G
          F              H         I
     State the result of pre-order, in-order and post-order traversal of
the tree.                [4]
                                    OR
Q-4 a) Define threaded binary tree. Describe its node structure and
advantages over unthreaded binary tree.
                                                                      [4]
       b) Construct a binary search tree for following elements:
[4]
          52,77,62,26,45,97,33,16,49,35,88.
     Reconstruct this tree after following operations:
          1.   Node 90 is added
          2.   Node 26 is deleted.

Data File Structure 2001



                             GUJARAT UNIVERSITY
                              MCA. Semester II
                            Data & File Structure

Date: 30th July, 2001
Marks:50

INSTRUCTIONS:
  1.    Attempt both the Sections in separate answer books.
  2.     Right side indicates the marks.
  3.     Assume suitable data wherever required.

                              SECTION I
Q-1  Answer the following Questions:
[9]
  (A) What is Primitive & Non Primitive data Structures? Explain with
suitable example.
  (B) Write an algorithm to check whether a string is palindrome or not
using stack.
  (C) What is recursion & Explain the problem of Towers of Hanoi with
algorithm?

Q.2.Answer the following questions:
[8]
  (A)  Write an algorithm for converting an Infix Expression into Postfix
     Expression with brackets & convert
     following expression into postfix:
         A*B+(C*D/E)*F-G
     (B)   Write an algorithm that inserts a node in doubly linked list in
ascending order.
                                     OR
Q.2.Answer the following questions:
[8]
  (A)  Write an algorithm to insert a node in an ordered threaded binary tree
  (B)   Explain the Circular queue with an example & explain the inserting &
     deleting algorithm for that.


Q.3 Answer the following questions:

[8]

  (A)  Write an algorithm to find all the leaf nodes & nodes which have only
     one child from an ordered Unary
        tree.
  (B)  Write an algorithm to delete a root node from an ordered binary tree.
                                     OR
    (B)   Define different methods for traversal  of tree with  suitable
example.
                                     OR
Q.3 Answer the following questions:
[8]
     (A)   Write an algorithm for conversion of general tree into binary
tree & trace with the following example.



  (C)  Explain how threaded binary tree is more efficient than ordered binary
     tree Give node representation in
      threaded binary tree.
 
                                 SECTION II

Q.4 Answer the following questions (Any six)
[9]
  1.      Prove that the complete binary tree with n nodes exactly n+l null
  branches.
  2.      Explain the Hierarchical approach of the data base system.
  3.      Write note on collision-resolution technique.
  4.      Explain multiplicative hashing method.
  5.      Explain Cellular Partitioned structure.
  6.      Write notes on Spanning Trees.
  7.      Write notes on three external storage devices in brief.
  8.      What do you understand by sequential files explain the.structure
  of sequential files.                                 '
  9.      Explain the structure of direct files?

Q.5 Answer the following questions:
[8]
     (A)   Write an algorithm for quick sort & sort the following data using
     quick sort.
          10, 23,64,21, 74, 9S, 2, 59,44,87, 55
     (B)   Explain the method for inserting & deleting a node in weight
     balance tree with suitable example.
                                     OR
Q.5 Answer the following questions:
[8]
      (A)   Write algorithms for creation of heap & sorting of heap. Sort
      the following data using heap sort.
           20,65,43,53,78,10,78,40,39,29
      (B)   Explain in detail index sequential file organization.
 Q.6   Write short note on following (any two)
 [8]
      (A)   Write an algorithm for linear search & binary search.
      (B)   Write notes on BFS using suitable example.
        (C)   Write an algorithm for radix sort & sort the following data
using radix sort.
           50, 31, 66, 309, 408, 201,49,53,576,11
      (D)   Define the following terms:
           1. Null Graph            2. Weight Graph                   3.
           Isolated node
           4. Graph              .     5. Complete binary tree         6.
           Forest
           7. Converse Inorder   8. Converse Preorder



DBMS 1998


Gujarat University

DCSA
DBMS

Date:22-4-1998                                                                                                                                              Marks:

Instructions:
1.      Answer both the section is separate answer books.
2.      Make and state necessary assumptions.

Section I


Q-1      Do as directed:                                                                                                                                                [9]

a)      What is the difference between any and ALL operator in SQL.
b)      Give the difference between procedural and non-procedural languages.
c)      List the SQL statements included in DML.
d)     Give the difference between Equi-Join and Natural-Join.
e)      Name the central module of DBMS and list its major functions.
f)       Explain the term Redundancy and five the example.
g)      Define the function Dependency.
h)      What does data dictionary store? It is referrred when and why?
i)        List the components of Relational DBMS.

Q-2      The bank in a city offers three types of accounts: Saving, Current and Fixed Deposit. It operates no. of
branches and a client of the bank can have any no. of accounts. Accounts can be joint. Identify the entities of interest and show their attributes. Draw the complete ER diagram.                                                  [8]

OR

Q-2      Construct an ER diagram for a university’s Register’s office. The office maintains data about each class
including the instructor, the enrolment and the time and place at the class meeting.                                                [8]

Q-3 a) What are the anomalies? Describe different anomalies using example.                                                          [4]
       b) Explain ANSI/SPARC architecture for DBMS.                                                                                             [4]

OR

Q-3 a) Describe the integrity rules with proper examples.                                                                                          [4]
       b) Explain BCNF with example.                                                                                                                         [4]

Section II


Q-4      Consider the following database:                                                                                                                   [9]

            Supplier (Scode, Sname, Scity)
            Item (Icode, Iname, Unit_price)
            Supplier_It (Scode, Icode, Qty, Date)
            Solve the following queries in SQL:
a)      List the items having unit-price in the range of Rs.100 to Rs.200 inclusive.
b)      List the suppliers who have not supplied any item.
c)      List the pairs of suppliers who have supplied an item ‘Sugar’. Eliminate the duplicates.
d)     List Sname, Iname, Qty and Date for all supplies.
e)      List the supplier names who have supplied at least one item supplied by supplier ‘S101’.
f)       Count no. of suppliers in each city. Display city and count in the order of city.

Q-5      Write short notes on any TWO:                                                                                                                      [8]
a)      Networks Data Model
b)      Security
c)      Multivalued Dependency
d)     Translation

Q-6      Write short notes on any two:                                                                                                                         [8]
a)      Non-loss Decomposition
b)      Role of DBA
c)      Data dependence
d)     Function Dependency Diagram

DBMS - I 1999


Gujarat University
MCA Semester II
Data base Management System –I

Date: 22nd July, 1999                                                                                                                         Marks:50

1  Do as directed:
( a ) What do you understand by the term  ‘Relational System ‘ ? Distinguish between relational and non-relational systems.                                                                                                                               3
(b) List the major functions performed by DBA.                                                                               2
(c) Explain non-loss decomposition with example     .                                                                       4.
2  (a) What is Data Dictionary? what does it contain  when & why is it referred?.                                4
     (b) Explain the referential integrity with example, what are the impacts of it on insert, 'delete and update
           operations.                                                                                                                                     4
OR
2        (a) What are the concurrency problems in database systems?  Explain the various solutions to these
            problems.                                                                                                                                      6
   (b) Define. The primary key in terms of function dependency. Give example.                                2         
3  Consider the following database of blood-bank :                                                                               8
Donner ( Donner-ld, Name, Blood-group, City)
Collection (Collection-Center-ld, Collection-date, Bag-no, Donner-ld)
Issue( Bag-no, Issue-Date, Hospital_id)
Hospital (Hospital- Id, Name, City)
Solve the following queries in SQL {any six)
(i) List the donners with details who donated on 1-1-1997.
(ii) List hospitals with details which have  not  taken  blood bags so far.
{iii) List the hospitals, blood group wise.
(iv)  List the details of donners who have donated blood more than 10 times.
(v). List the collection centres where more than 100 bags are collected.                 
(vi) List the name of hospitals to whom the blood of donner "Mr. Ramakant'* is issued.
(vii) List pairs of Donner, hospital names which are in same city and that hospital has been issued blood
        of that donner.
(ix)  List the details of blood donations made by "Mr Paresh" in the order of date.
(x) List the current stock of blood bags

 

SECTION II


4.   A travel agency is providing following services to its regular customers through the no. of branches
             located in various cities of  the  state t Hotel  booking  and  travel reservation. This agency has been
             authorised to make the booking In various hotels at   different places as well as reserve .the tickets in
       airlines/railways  The management  of travel agency wants to computerize the above information. Draw
       the E.R. diagram mentioning Entities, attributes & relations .                                                         9
      5.  The following table describes the projects on which groups of  employees are working                    
PROJECT-EMPLOYEE-TABLE (Project-Id, Emp-ld, Project-desc, Project -leader,  Date-of-start. Period,  Emp-Name,  Experience-in-years, Date-of-Employee-Joined-project.)
        Identify all the FD’s and normalise above relation into set of 3 mF. relations.

OR

      5   (a)  What is two-phase commit ? How does it help in recovery?                                                        4
    (b) What are views?  Show its usefulness in  DBMS by examples.                                                      4         
      6  Write short notes on (any 3)                                         -                                                                         8
(i)                 Optimization
(ii)               Problems in Distributed DBMS
(iii)             Problems of Null Values in database
(iv)             Compare hierarchical, Network & Relational Models
(v)               Relational Algebra operations



Database Management System - I 2000


Gujarat University

MCA Semester - III

SECTION –I


Q.1   Attempt ANY TWO from the following:                                                                      [Marks: 10]
a.       What is a relation ? Relational Algebra? Write a note on relational algebra operations/
b.         Explain ANSI/SPARC architecture.
c.   Write a note on security controls supported by SQL.
Q-2  Attempt ANY TWO from the following:                                                                      [Marks: 10]
a.       Write a note on the objectives of distributed Data base management system.
b.   Consider the following :
Supplier (sno, sname, city, status)
Parts (pno,pname, color, weight, city)        
Shipment (sno, pno, qty, price)        
Write SQL queries to accomplish the following:
i.            List the name of the part supplied by all the suppliers.
         ii.            List the highest quoted price for each part.
iii.                   Extract the supplier information for the suppliers who are supplying  any red part.
iv.                   List the supplier name and the total number of parts supplied  by him.
c.   Discuss the limitations of traditional file system.
Q.3. Attempt ANY ONE from the following:                                           [Marks:05]
a.   Write a note on hierarchical model & network model.
b.      The Bank of X has number of branches in different cities. But one city can have only one branch. The head office is in Ahmedabad city. For each branch, a blanch number, branch name, its address with city name, and whether the branch is a head office, a regional office or local office is stored. Each branch has a number of customers with the condition that the customer can't have more than one account in one branch but can have accounts in any number of branches. The customer data are maintained which include unique customer number, name, address, & whether the customer is domestic or commercial .The accounts are given unique number within the branch. The accounts may be of saving type or current account. The customer can do any number of transactions in a day with any branch. The transaction is identified by the date, time, transaction number, account number, amount, & whether it a withdrawal or deposit.
            The branch has to maintain the database.
Draw the ER diagram and clearly define the tables with their primary keys, candidate keys and
foreign keys.


SECTION-II

Q.4. Attempt ANY TWO from the following:                                                                  [Marks: 15]
a.   Write a note on 1nf, 2nf, 3nf, & BCNF.
b.   Write a note on the concurrency-related problems.
c.   Discuss aspects of the security problem. Also discuss the importance of an audit trail.
Q.5. Attempt ANY TWO from the following:                                                                   [Marks: 10]
a.   Write a note on advantages of relational data base management system.
c.       Explain the concept of foreign key, primary key, domain & entity with Example.
d.      What is system recovery? Explain REDO and UNDO.