You are on page 1of 15

BT0033

DATA STRUCTURE USING C [1 mark each]


1) Most appropriate data structure in C to represent linked list is a) array b) struct c) union d) none of the above 2) Link of linked list in C is of type a) unsigned integer b) Pointer to integer c) Pointer to struct d) None of the above 3) In linked list, a node contains at least a) Node address field, data filed b) Node number, data field c) Next address field, information field d) None of these 4) In linked list, the logical order of elements a) Is same as their physical arrangement b) Is not necessarily equivalent to their physical arrangement c) Is determined by their physical arrangement d) None of the above. 5) Direct or random access of element is not possible ina) Linked list b) Array c) String d) None of the above 6) In linked list, the successive elementsa) Must occupy contiguous space in memory b) Need not occupy contiguous space in memory c) Must not occupy contiguous space in memory d) None of the above 7) NULL pointer is used to tell a) End of linked list b) Empty pointer field of a structure c) The linked list is empty d) All of the above

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<=0 Then write (stack UNDERFLOW) Return S[TOP -1 +i] Return a) b) c) d) 1 and 3 1 and 4 only 4 No Error

43) Select the true statements regarding simulation from a real situation It is the process of forming an abstract model from a real situation It permits experimentation by modifying real situation Large detailed simulation can be executed in computer with reasonable cost a) 1 and 3 b) 2 and 3 c) only 1 d) None of these 44) Consider the expression A/B * C * D + E the post order of this given by a) + */* ABCDE, ABCDE/** + b) + **/ ABCDE, ABC/D * E * + c) +**/ EDCBA, AB/C * D * E + d) +**/ABCDE, AB/C * D *E + 45) Choose the properties of non-empty Binary search tree Every element has a key, and no two element have the same key, that is the key is unique The keys in a non-empty left sub-tree must be larger than the key in the root of the sub tree The left and right sub-trees are also binary search tree a) b) c) d) 1 and 2 2 and 3 1 and 3 1, 2 and 3

46) Select the true statements with respect to magnetic disks They provide low access time and high speed data transfer The outermost surfaces of the top and bottom platters are not used for storing data Information is transferred to or from a disk through read/write heads a) b) c) d) 1 and 2 2 and 3 1 and 3 1,2 and 3

47) Suppose we want to store a file with 50000 fixed length data records on a typical 2.1giga- byte disk with the following characteristics: Number of bytes/sector = 512 Number of sectors /track = 63 Number of tracks/ cylinder = 16 Number of cylinders = 4092 How many cylinders does the file require if each data record requires 256 bytes? a) 12.4

b) 24.8 c) 28.4 d) 12.8 48) Select true statements regarding hashing: It is a technique used for performing insertions, deletions and finding constant average time Hash table is the central data structure a) b) c) d) 1 and 2 1 and 3 2 and 3 1, 2 and 3 Set B 1. Hi (key) =(hash(key +12)) 2. Primary clustering occurs in this case 3. It avoids pointers usage to chain elements together 4. Each key is mapped into some bucket number ranging 5. All elements that hash into same value are placed in a (iii) -3 (iii) -1 (iii) -2 (iii) -2 (iv) -1 (iv) -4 (iv) -1 (iv) -3 (v) -1 (v) -4 (v) -3 (v) -1

49) Match the following Set A (i) Hash function (ii) Separate chaining (iii)I linear probing (iv) quadratic Probing (v) Open addressing list a) b) c) d) (i) -4 (i) -2 (i) -4 (i) -4

(ii) -2 (ii) -3 (ii) -5 (ii) -5

50) Select the true statements Insertion and deletion of elements to and from a data structure in pointers is time consuming Fixed longer bit sequences can be handled more efficiently than variable fength bit sequence Pointers provides a homogeneous method of referencing any data structures Selection operation changes the data in the structure Using functions one or more values can be returned to the main routine a) b) c) d) (i) (iii) true (ii) (iv) (v) true (i) (iv) (v) true (ii) (iii) true

51) The two sub arrays obtained by applying quick sort aigorithm on the array 26 5 37 1 61 59 15 48 19 as first step is a) [11 5 15 1] 59 [26 61 48 37]

b) [5 19 15 1 26 ] 11 [59 61 48 37] c) [11 5 19 1 15] 26 [59 61 48 37] d) [5 19 1 15 26] 11 [59 61 48 37] 52) Select the true statements Magnetic Disk is preferred for high-speed, large volume batch processing applications A drum is referred to as a direct-access storage device In magnetic disk the outmost surfaces of the top and bottom platters are used for data storing Magnetic tab is a plastic ribbon coated on one side with an iron oxide material Magnetic disk provides high access time a) b) c) d) (iii) and (iv) are true (ii) and (iv) are true (i), (ii) and (iv) are true (ii), (iii) and (v) are true

53) Arrange the following statement to make it a correct algorithm for pop operation of stack data structure. A) decrement top B) check for stack underflow. If underflows repot it and exit otherwise proceed C) return the element a) b) c) d) A, B,C B, C, A B, A, C None

54) Let productions be P1 = ab b P2 = ac c P3 = aa a P4 = bb b On the alphabet v = {a, b, c} f input string is (i) bcaabaabcabaa (ii) baacaabacaa The output of MARKOV algorithm is a) b) c) d) (i) bcbcba (i) bcba (i) bcbac (i) bcbca (ii) bcbca (ii) bca (ii) bcca (ii) bcbcba

55) Node is consist of _________ and __________.

a b c d

Float, link Integer, link Information, link None

d) What all operations are related with stack A) Push B) Pop C) Change D) Peep E) Pipe e) f) g) h) All operations Last three operation First three operations First four operations

57) What is main advantage of Circular queue over simple queue a) b) c) d) Efficient Efficient use of memory saving Work slow but good to listen None of the above

58) Which of the following is true for linear search? a) N comparison to find D in the worst case, N/2 comparison on the average case and one comparison in best case b) N/2 Comparison to find d in the worst case, N Comparison on the average case and one comparison in best case c) 1 comparison to find D in the worst case, N/2 Comparison on the average case and N comparison in best case d) 1 comparison to find D in the worst case, N comparison on the average case and N/2 comparison in best case 59) What kind of list is best to answer questions such as What is the item at position n? a) b) c) d) Lists implemented with an array. Doubly-linked lists. Singly-linked lists. Doubly-linked r singly-linked lists are equally best

60) What is the worst-case time & average time for quick sort to sort an array of n elements? a) O(log n), o(log n)

b) O(n), o(n log n) c) O(n log n), o(n2) d) o(n2), o(n log n)

[4 marks each]
61) Suppose you have a directed graph represented all the flights that an airline fillies. What algorithm might be used to find the best sequence of connections from one city to another? a) b) c) d) Breadth first search Depth first search A cycle-finding algorithm A shortest-path algorithm

62) For markov algorithm Input string: abcdcdipcd Production P1 : cdc --> 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 left_child = ABC (Element, T left_child); 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 structures 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 3 4 8

a. 2

6 8 4

b. 6 2 1 3 8

c. 2 1 3

6 8

d. 2 1 3

6 8

You might also like