CUSTOMER_CODE SMUDE DIVISION_CODE SMUDE

advertisement
CUSTOMER_CODE
SMUDE
DIVISION_CODE
SMUDE
EVENT_CODE
SMUAPR15
ASSESSMENT_CODE MIT102_SMUAPR15
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
12135
QUESTION_TEXT
Explain different types of graphs.
1. Undirected graphs (Exp n 1 mark)
2. Directed graphs (Exp n 1 mark)
3. Weighted graphs (Exp n 1 mark)
4. Multigraph (Exp n 1 mark)
5. Sparse graph (Exp n 1 mark)
SCHEME OF EVALUATION
6. Acyclic graph (Exp n 1 mark)
7. Graph with isolated vertices (Exp n 1 mark)
8. NULL graph (Exp n 1 mark)
9. Strongly connected graph (Exp n 1 mark)
10. Uniaterally connected graph (Exp n 1 mark)
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
12136
QUESTION_TEXT
Explain the types of representation of binary tree in
memory.
SCHEME OF
EVALUATION
1.Array representation of binary tree (5 Marks)
2.Linked storage representation of binary tree (5 Marks)
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
73331
QUESTION_TEXT Give an account of types of mass storage devices
SCHEME OF
EVALUATION
Floppy disks: Relatively slow and have a small capacity, but they are
portable, inexpensive, and universal.
* Hard disks: Very fast and with more capacity than floppy disks,
but also more expensive. Some hard disk systems are portable
(removable cartridges), but most are not.
* Optical disks: Unlike floppy and hard disks, which use
electromagnetism to encode data, optical disk systems use a laser to
read and write data. Optical disks have very large storage capacity,
but they are not as fast as hard disks. In addition, the inexpensive
optical disk drives are read-only. Read/write varieties are expensive.
* Tapes: Relatively inexpensive and can have very large storage
capacities, but they do not permit random access of data.
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
73333
QUESTION_TEXT
Explain the array implementation of stack.
SCHEME OF
EVALUATION
Push operation:
5 Marks
PUSH (STACK, TOP, MAXSTK, ITEM)
1. [STACK ALREADY FULL?]
If TOP=MAXSTK, THEN PRINT ‘OVERFLOW’ AND
RETURN;
2. SET TOP=TOP+1
3. SET STACK[TOP]=ITEM
4. RETURN
Pop operation:
5 Marks
POP (STACK, TOP, ITEM)
1. [STACK IS EMPTY?]
IF TOP=-1, THEN PRINT ‘STACK EMPTY’ AND
RETURN
2. SET ITEM = STACK[TOP]
3. SET TOP=TOP-1
4. RETURN
QUESTION_TYPE
DESCRIPTIVE_QUESTION
QUESTION_ID
120231
QUESTION_TEXT What is static hashing? Explain linear hashing.
SCHEME OF
EVALUATION
Static hashing
Static hashing is a simple form of hashing, where hashing is the technique
use mathematical functions to sort incoming data in a speedy and
organized fashion. Hashing involves a hashing function, which accepts a
piece of incoming data and assigns to that data a specific value; based on
that value the data is stored away in a table. Static hashing is a simple form
of hashing often used for a temporary solution, until a better form of
hashing such as linear hashing or extendible hashing can be used. Its
advantage is its relative simplicity compared to other types of hashing.
Here hashing is called static because the number of buckets is static,
meaning that the number is determined first and remains constant
throughout the assembly and use of hash.
A simple example of hash function is h(x)=xmod N. this means that the
remainder of x divided by N is what is returned. Once this hash value has
been determined, the whole piece of data is then sorted into a bucket with
a number of other data entries with the same hash value. These buckets
usually have a static size as well and they each have overflow buckets in
case the first bucket gets full.
To locate a particular item, the search information provided is passed
through the hash function again, so the search is quickly narrowed down
to roughly 1/N of the total pieces of data that might otherwise be
searched. The defect in static hashing is the fact that the number of
buckets remain static. This means that if all the values tend to produce one
particular hash value, all of the data records will go to one bucket, not
saving much time. Other methods of hashing allow for the creation of new
buckets on the fly, which can be assigned more specific hash values to
break down a clump of data. Static hashing is good for speedy data. (5
marks)
Linear hashing
Linear Hashing is a dynamically updateable disk-based index
structure which implements a hashing scheme and which grows or
shrinks one bucket at a time. The index is used to support exact
match queries, i.e. find the record with a given key. Linear hashing
does not use a bucket directory, and when an overflow occurs it is not
always the overflow bucket that is split. The name linear hashing is
used because the number of buckets grows or shrinks in a linear
fashion. Overflows are handled by creating a chain of pages under the
overflow bucket. The hashing function changes dynamically and at
any given instant there can be at most two hashing functions used by
the scheme. Some of the main points that summarize linear hashing
are; Full buckets are not necessarily split, and buckets split are not
necessarily full. Every bucket will be split sooner or later and so all
Overflows will be reclaimed and rehashed. Split points s decides
which bucket to split and s is independent to overflowing bucket and
at level i , s is between 0 and 2i. s will be incremented at each point if
it reaches end it will be reset to 0. (5 marks)
QUESTION_TYP
DESCRIPTIVE_QUESTION
E
QUESTION_ID
120234
QUESTION_TEX
Write the steps for converting the general tree to a binary tree.
T
1. The root of the general tree must be the root of the binary tree
SCHEME OF
EVALUATION
(1 mark)
2. Determine the first child of the root which is the left most node in the
general tree at the next level.
(1 mark)
3. Insert this node.
The child-parent relationship in general tree would be considered in binary
tree also
(1
mark)
4. Continue finding the first child of each parent node and insert it below the
parent child
(1 mark)
5. When no more first children exist in the path just used, move back to the
parent of the last node entered and determine the next sibling, then insert
right to the previous left sibling (where sibling in general tree would be child
in binary tree)
(3 marks)
6. In order to complete the tree, the following steps to be executed:
→Look for the completion of sibling at one generation level
→Next move to left most child of the successor generation and
repeat the process as same until the sibling of the generation are
inserted
(3 marks)
Download