BT0033 DATA STRUCTURE USING C PAPER 2 (BSciIT SEM 1)

Share Embed Donate


Short Description

Download BT0033 DATA STRUCTURE USING C PAPER 2 (BSciIT SEM 1)...

Description

BT0033 DATA STRUCTURE USING C [1 mark each] 1) Most appropria appropriate te data structure structure in C to represent represent linked linked list is a) array  b) struct c) union d) none none of the the abo above ve 2) Link Link of linked linked list list in in C is is of type a) unsi unsign gned ed inte intege ger  r  b) Pointer to integer  c) Pointer to struct d) None None of the the abo above ve 3) In linked linked list list,, a node node contains contains at least least a) Node Node addre address ss fiel field, d, data data fil filed ed  b) Node number, number, data data field c) Next Next addres addresss field, field, infor informat mation ion fiel field d d) None None of these hese 4) In linked linked list list,, the logic logical al order order of elem elements ents a) Is same same as their their physica physicall arrang arrangeme ement nt  b) Is not necessarily equivalent to their physical arrangement c) Is deter determine mined d by their their physical physical arra arrange ngement ment d) None None of the the abo above ve.. 5) Direct or random random access access of element element is not possible possible ina) Linked list  b) Array c) String d) None None of the the abo above ve 6) In linked linked list list,, the succes successive sive elem elements ents-a) Must occupy contiguous space in memory  b) Need not occupy contiguous space in memory c) Must Must not occup occupy y contigu contiguous ous space space in in memory memory d) None None of the the abo above ve 7) NULL NULL point pointer er is is used used to to tell tell a) End of linked list  b) Empty pointer pointer field field of a structure structure c) The linke linked d lis listt is is empt empty y d) All All of of the the abov abovee

8) Underflow condition in linked list may occur when attempting to a) Insert a new node when there is no free space for it b) Delete a non-existent node in the list c) Delete a node in empty list d) None of the above 9) Overflow condition in linked list may occur when attempting to a) Create a node when free space pool is empty  b) Traverse the nodes when free space pool is empty c) Create a node when linked list is empty d) None of the above 10) Header of a linked list is a special node at the a) End of linked b) At the middle of the list c) Beginning of the list d) None of the above 11) Header linked list in which last node points the header node is called a) Grounded header   b) Circular header list c) General header  d) None of the above 12) A technique, which collects all deleted space onto free storage list, is calleda) Static memory  b) Garbage collection allocation c) Dynamic allocation d) None of the above 13) Which of the following process is faster for threaded trees compared with their  unthreaded counterparts? a) Insertion b) Deletion c) Traversal d) None of these 14) Which of the following statements is TRUE in view of a threaded binary tree? It can have a) NULL links but no structural links  b) Only structural links but no NULL links c) Structural links and NULL links d) None of these 15) Which of the following steps is performed first for in order traversal of a binary tree?

a) b) c) d)

Traversal of the left sub tree in post order. Processing of the root node Traversal of the left sub tree in in-order None of the above

16) A B-tree of order n is also called a) (n-n)-1 tree  b) n-(n-2) tree c) (n-1)-n tree d) None of these 17) The preorder traversal of a binary tree begins witha) Processing of the root node  b) Traversal of the right sub tree in preorder  c) Traversal of the left sub tree in preorder  d) None of the above 18) If a binary search technique is used for accessing and implementing a symbol table, which of the following statements is TRUE? The ratio ofa) Insertion time to access time for its entries is quite high  b) Access time to insertion time is quite high c) Search time to insertion time is very high d) None of the above 19) The post order traversal of a binary tree begins a) The post order traversal of the left sub tree  b) Processing of the root node c) The post order traversal of the right sub tree d) None of the above 20) Which of the following figures is not possible as a balance of any node of an AV tree? a) 1  b) –1 c) 0 d) None of the above 21) The in-order traversal of some binary tree produced the sequence DBEAFC, and the  post order traversal of the same tree produced the sequence DEBFCA. What will be the total number of nodes on the left sub tree of the given tree? a) 1 b) 4 c) 5 d) None of these 22) Name the sort for which time is not proportional to n2 a) Merge sort

b) Bubble sort c) Quick sort d)  None of these 23) This sort does not use divide & conquer methodology a) Merge sort b) Bubble sort c) Quick sort d) None of these 24) Name the sort in which array to be sorted is partitioned again & again in such a way that all elements less than or equal to partition element appear before it and those which are greater appear after it. a) Merge sort b) Quick sort c) Selection sort d)  None of these 25) Worst case efficiency of this search is n. a) Sequential search b) Binary search c) Indexed search d)  None of these

26) Which is not a hashing technique? a) Division remainder method  b) Folding c) Mid square d) All are hashing technique 27) Extra space in each record is kept for this collision processing method a) Linear collision processing b) Linked collision processing c) Quadratic collision processing d) None of these 28) This method of collision processing requires prime area and overflow area. a) Linked collision processing  b) Quadratic collision processing c) Linear collision processing d) None of these 29) In this method of collision processing some of the addresses may remain unchecked. a) Linear collision processing  b) Quadratic collision processing c) Linked collision processing

d) None of these 30) In this search keys must be ordered a) Sequential search b) Hashing c) Binary search d) None of these 31) This searching method requires that all keys must reside in internal memory. a) Binary search  b) Sequential search c) Hashing d) None of these 32) A vertex with degree one in a graph is calleda) Leaf   b) Pendant vertex c) End vertex d) None of these 33) Which one is not a representation of a graph? (1) Adjacency matrix  b) Edge listing c) Adjacency list d) All represent graphs 34) In an adjacency matrix parallel edges are given bya) Similar columns  b) Similar rows c) Similar rows & similar columns d) None of the above 35) Breadth first search –  a) Scans all incident edges before moving to other vertex  b) Scans adjacent unvisited vertex as soon as possible c) Is same as backtracking d) None of these 36) Name the sort for which time is not proportional to n2 a) Selection sort b) Bubble sort c) Quick sort d) None of these 37) In which case adjacency list representation of graph is not useful a) When no of edges is small

 b) When no of vertices are changing due to insertion and deletion c) In breadth first traversal d) It is useful in all above cases 38) Which method of traversal does not use stack to hold nodes a) Breadth first  b) Depth first c) D-search d) None of these 39) Back tracking is another name for this method of traversal a) Depth first  b) Breadth first c) D-search d) None of these 40) The preorder traversal of a binary tree begins witha) Processing of the root node  b) Traversal of the right sub tree in preorder  c) traversal of the left sub tree in preorder  d) None of the above

[2 marks each] 41) Select the aspects of problem solving of an application Formulation of algorithms Selection of an appropriate mathematical model Design of storage structures for the Data structures a)  b) c) d)

1 and 3 2 and 3 1 and 2 2, 1 and 3

42) Consider the function given below. Choose the line number which has error function CHANGE (S, TOP, X,1) If TOP -1+i a What will be output? a)  b) c) d)

Abadipcd Abadlpa Abadlpd None

63) What is different between Circular linked list & simple linked list? a) Circular linked. List consist of only one node and link part store address of first node  b) Circular linked list consist of many node but all node are circular in nature c) Circular linked list is simple linked list but last mode link points to first nide.  None 64) Identify true and false statement Magnetic tapes have higher transfer rate than cards or paper tapes Magnetic tapes are available on reels is 21/2” to 3” wide and 2400 ft. long. Magnetic tapes cannot be erased and refused. a)  b) c) d)

True, false, false True, true, false False, false, true True, false, true

65) An IBM indexed sequential file consists of three separate areas – The _______ area, the  __________ area, and the __________ area.

a) Prime, index, overflow  b) Secondary memory, index, underflow c) Secondary memory, index, overflow d) None 66) Fill in the blanks to complete bubble sort algorithm for ( i= 1:i< = n; i++) { for (j = n; j>=i; j—) { if (a [j – 1] > A [j] ) /* ...............do*/ } }

/* do*/ means a) swap a[i] and a[j+1] b) swap a[j-1] and a[j] c) swap a[n-1] and a[n] d) swap a[j] and a[j+1] 67) Identify the following algorithm. Tree_pointer ABC (int Element, Tree_pointer T) { If (T = NULL) { T = malloc (sizeof (struct node)); T data = element; T left_child = T Right_child = NULL; } else If (Element T data) T right_child = ABC (Element, T right_child); Return T;} e) f) g) h)

BST insertion BST Deletion BFS Insertion BFS Deletion

68) Arrange the following statement to make it a correct algorithm for insert operation of  queue data structure a. Check for overflow, if overflows then report it and exit otherwise proceed.

 b. Insert element c. Increment rear pointer  d. Check front pointer. e. If it is zero then assign a value equal to one: a, c, b, d, e a, b, c, d, e d, b, a, c, e d, a, c, b, e

69) Select true statements regarding pointers 1. A pointer is a reference to a data structure 2. Pointer provides a homogeneous method of referencing any data structure to developing upon the structure’s types 3. It permits faster insertion and deletion of element to end from a data structure 4. Pointer addressing method is less time consuming than the computed address method 5. The pointer value provides a reference to the data structure of interest i)  j) k) l)

1, 3 and 5 4 and 5 1, 2, 3 and 4 1, 3, 4 and 5

70) Select true statements regarding grammar  1. A grammar is a specification that takes into account syntactic properties of a language 2. A grammar consists of finite set of replacement rules or productions 3. Grammar can be defined as G= (VT, Vs, S, P) 4. All strings composed of terminal symbols form sentences a  b c d

1 and 4 2 and 3 1, 2 and 4 All of above

71) Select the true statement regarding circular linked linear list 1. Deletion operation is very difficult & not much efficient. 2 Concatenation is more efficient. 3. It is possible to get into an infinite loop 4. Every node is accessible from a given node 5. Splitting is complex, non efficient process m) 1, 3 & 5

n) 1, 2 & 5 o) 2, 3 & 4  p) All of above 72) Choose the facts about index. 1. Except to use many fewer blocks for index than for data file 2. Index sorted, use linear search on index. 3. Especially useful when index can fit in memory. 4. If n index blocks, only log2 n disk I/Os 5. Indexes are additional auxiliary access structure, which provide faster access to data. q) r) s) t)

1, 2 and 4 1, 3, 4 and 5 1, 2, and 5 All of above

73) Select the true statements regarding magnetic tapes 1. It provides a compact and an inexpensive method of storing data and programs 2.It is preferred for low speed, large volume batch processing applications 3. 3 types magnetic tapes are used. 4. Magnetic tapes are randomly accessed 5.It is divided into either 7 or 9 parallel horizontal rows and vertical columns u) v) w) x)

1, 5 2, 3 1, 2, 4 and 5 All of above

74) Consider the algorithm for stack push. Fill the gaps with appropriate value. Void stack push(stack_t stack, data * data) { node_t *new_node, if (___________) { new node = (node_t*)

malloc (size of 9 node_t);

(size of (node_t); new_node data = ________________  new_node next = stack_top; stack stack_top =_______________  } } y) stack =0, stack--> data, new-->node

z) stack !=0, data, new_node aa) stack =0, stack--> new_node  bb) stack !=0, data, new-->node

75) Given the tree, what is the resultant tree after 4 is deleted from the tree 6 2 1

8 4

3

a.

6

b. 6

2

8 4

1

2

8

3 1 3

c.

d.

6 2 1

6 2

8 3

1 3

8

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF