• No results found

QUESTION BANK DS

N/A
N/A
Protected

Academic year: 2020

Share "QUESTION BANK DS"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

Nehru Arts and Science College

Department of Information & Computer Technology

Unit Test – 01 Date:

Reg. No: Name:

Subject: DATA STRUCTURES Class: II CT

Max Marks: 55 Duration:

SECTION A (25 X 1=25) 1 Every algorithm must satisfy___________________

(a)Input (b)Finiteness (c)All the above 2 Sparse matrix has _______________

(a)many zero entries (b)many non-zero entries (c)higher dimension 3Which of the following name does not relate to stacks?

(a)FIFO lists (b)LIFO list (c)Push-down lists

4The term "push" and "pop" is related to the ____________________ (a)array (b)lists (c)stacks

5Two dimensional arrays are also called ________________ (a)tables arrays (b)matrix arrays (c)both of above

6Two main measures of the algorithm are _________________

(a)Processor and memory (b)Complexity and capacity (c)Time and space

7The time factor when determining the efficiency of the algorithm is measured by ________________ (a)Counting microseconds (b)Counting number of key operations (c)Counting number of statements 8The space factor when determining the efficiency of the algorithm is measured by _______________ (a)Counting the maximum memory needed by the algorithm (b)Counting the minimum memory needed by the algorithm (c)Counting the average memory needed by the algorithm

9Which data structure allows deleting data elements from front and inserting at rear? (a)Stacks (b)Queues (c)Dequeus

10Which of the following data structure is non-linear type? (a)Lists (b)Stacks (c)None of the above

11The postfix expression of the prefix *+ab-cd is _________________ (a)ab+cd-* (b)abcd+-* (c)ab+cd-*

12Which of the following data structures are indexed structures? (a)linear arrays (b)linked lists (c)both of the above

13___________ is a sequential representation of similar data types. (a)Queue (b)Array (c)Stack

14Which of the following data structure is linear data structure? (a)Trees (b)Graphs (c)Arrays

15The data structure required to evaluate a postfix expression is ________________ (a)queue (b)stack (c)array

(2)

17If the sequence of operations – push(1), push(2), pop(), push(1),push(2),pop, pop, pop, push(2), pop are performed on a stack, the sequence of popped out values are?

(a)2,2,1,1,2 (b)2,2,1,2,2 (c)2,1,2,2,1

18The initial configuration of the queue is a,b,c,d(a is the front end). To get the configuration of d,c,b,a one needs a minimum of ______________

(a)2 deletions and 3 additions (b)3 additions and 2 deletions (c)3 deletions and 3 additions 19Which data structure is needed to convert infix notation to postfix notation?

(a)Branch (b)Queue (c)Stack

20What is the result of the following operation Top (Push (S, X)) ? (a)X (b)S (c)null

21If the address of A[1][1] and A[2][1] are 1000 and 1010 respectively and each element occupies 2 bytes then the array has been stored in _________ order

(a)column major (b)row major (c)matix major

22Arrays are best data structures _________________

(a)for relatively permanent collections of data (b)for the size of the structure and the data in the structure are constantly changing (c)for both of above situation

23The data structure which is one ended is _________________ (a)queue (b)stack (c)tree

24which of the following is ordered list? (a)stack (b)queue (c)both of the above

25 Queues are following ____________ discipline. (a)LIFO (b) FILO (c) FIFO (d) LILO.

SECTION B (4 X 5=20)

1. What is an algorithm? What are the characteristics of a good algorithm? 2. Explain the operations performed on Stack?

3. What is recursion? Write recursive algorithms for finding n! and computing the nth Fibonacci

number?

4. Narrate circular queues briefly. Write the algorithms for addition and deletion operations. 5. Write about multiple Stacks and Queues.

SECTION C (10 X 1 = 10) 1. Write a detailed note on storage representation of arrays.

2. Discuss about arrays. Write the TRANSPOSE algorithm of Sparse matrix.

3. Define expression. How can we convert an expression from infix notation to postfix notation. 4. Write in detail about the queues with an illustration.

(3)

Nehru Arts and Science College

Department of Information & Computer Technology

Unit Test – 02 Date:

Reg. No: Name:

Subject: DATA STRUCTURES Class: II CT

Max Marks: 55 Duration:

SECTION A (25 X 1 = 25) 1In a circular linked list________________

(a)components are all linked together in some sequential manner. (b)there is no beginning and no end. (c)components are arranged hierarchically. (d)forward and backward traversal within the list is permitted.

2A linear collection of data elements where the linear node is given by means of pointer is called________

(a)linked list (b)node list (c)primitive list (d)None of these

3The OS of a computer may periodically collect all the free memory space to form contiguous block of free space. This is called___________

(a)Concatenation (b)Garbage collection (c)Collision (4)Dynamic Memory Allocation

4Which of the following operations is performed more efficiently by doubly linked list than by singly linked list?

(a)Deleting a node whose location in given (2)Searching of an unsorted list for a given item (c)Inverting a node after the node with given location (d)Traversing a list to process each node

5A _____________ list is a list where the last node contains null pointer. (a)circular header. (b)grounded header. (c)rounded header. (d)linked header.

6A linked list whose last node points back to the list node instead of containing the null pointer________. (a)circular linked list (b)linked list. (c)circular doubly linked list. (d)doubly linked list.

7The _________ for a linked list is a pointer variable that locates the beginning (a)anchor. (b)base. (c)footer. (d)header.

8A _________linked list is a linked list which always contains a special node called the header node, at the beginning of the list.

(a)Doubly Linked List. (b)Circular List. (c)Header Linked List. (d)None.

9_______________is a header list where the last node points back to the header node.

(a)Doubly header List (b)Singly header List. (c)Grounder Header List (d)Circular Header List. 10The advantage of a two-way list and a circular header list is combined into a ________ (a)two-way circular header list (b)two-way circular list.(c)two-way header circular list (d)None 11The pointer of the last node contains a special value called_____________.

(a)null pointer. (b)index pointer (c)pointer link. (4)address pointer

(4)

13Which of the following is two way lists?

(a)Grounded header list (b)Circular header list (c)linked list with header, left pointer and right pointer nodes(d)Singly linked list

14Allocating memory for arrays during program compilation is___________

(a)dynamic memory allocation (b)memory allocation (c)static allocation (d)random allocation 15A variable P is called pointer if _______.

(a)P contains the address of an element in DATA (b)P points to the address of first element in DATA. (c)P can store only memory addresses (d)P contain the DATA and the address of DATA. 16The dummy header in linked list contains _______.

(a)Last record of the actual data. (b)First record of the actual data. (c)Pointer to the last record of the actual data.(d)None of the above.

17Which of the following data structure is not linear data structure? (a)Arrays (b)Linked lists (c)Both of the above (d)None of the above 18The disadvantage in using a circular linked list is ...

(a)It is possible to get into infinite loop. (b)Last node points to first node (c)Time consuming (d)Requires more memory space

19In a linked list with n nodes, the time taken to insert an element after an element pointed by some pointer is_______________

(a)O(a)(b)O(log n) (c)O(n) (d)O(n log n)

20Stack can be represented by means of ____________. (a)Tree. (b)Graph (c)One-way List. (d)None

21The time required to delete a node x from a doubly linked list having n nodes is___________ (a)O(n) (b)O(log n) (c)O(a)(d)O(n log n)

22The situation when in a linked list START=NULL is ______________ (a)Underflow (b)Overflow (c)Houseful (d)Saturated.

23In a circularly linked list organization, insertion of a record involves the modification of _________ (a)no pointer (b)1 pointer (c)2 pointers (d)3 pointers

24Which of the following statement is false?

(a)Arrays are dense lists and static data structure (b)data elements in linked list need not be stored in adjacent space in memory (c)pointers store the next data element of a list (d)linked lists are collection of the nodes that contain information part and next pointer

(5)

SECTION B (4 X 5=20)

1. Write short note on dynamic storage management. 2. Explain the applications of linked list.

3. Explain linked stacks briefly.Write the algorithms for addition and deletion operations. 4. Discuss the concept of doubly linked list.

5. Write the procedure to invert a list and concatenate two list.

SECTION C (10X1=10))

1. Describe in detail about single linked list.

2. How can we add two polynomial using linked list concept?

(6)

Nehru Arts and Science College

Department of Information & Computer Technology Unit Test – 03 Date:

Reg. No: Name:

Subject: DATA STRUCTURES Class: II CT

Max Marks: 55 Duration:

SECTION A (25X1=25) 1.The maximum degree of any vertex in a simple graph with n vertices is

(a)n–1 (b)n+1 (c)2n–1 (d)n

2The data structure required for Breadth First Traversal on a graph is (a)queue (b)stack (c)array (d)tree

3The number of different directed trees with 3 nodes are (a)2 (b)3 (c)4 (d)5

4One can convert a binary tree into its mirror image by traversing it in (a)inorder (b)preorder (c)postorder (d)any order

5An adjacency matrix representation of a graph cannot contain information of (a)nodes (b)edges (c)direction of edges (d)parallel edges

6To represent hierarchical relationship between elements, which data structure is suitable? (a)Dequeue. (b)Priority (c)Tree. (d)Binary tree.

7A binary tree whose every node has either zero or two children is called___________. (a)complete binary tree (b)binary search tree (c)extended binary tree. (d)binary tree. 8The depth of a complete binary tree is given by__________.

(a)Dn = n log2n. (b)Dn = n log2n+1 (c)Dn = log2n. (4)Dn = log2n+1.

9The post order traversal of a binary tree is DEBFCA. Find out the preorder traversal. (a)ABFCDE. (b)ADBFEC (c)ABDECF (d)ABDCEF

10In a binary tree, certain null entries are replaced by special pointers which point to nodes higher in the tree for efficiency. These special pointers are called___________.

(a)leaf (b)branch (c)path (d)thread.

11Breadth First search is used in____________. (a)binary tree (b)binary tree (c)graphs (d)both a and c

12The minimum number of edges in a connected cyclic graph on n vertices is________. (a)n-1 (b)n+1 (c)n (d)n+2

13In a graph if e = [u, v], Then u and v are called _________. (a)endpoints of e (b)adjacent nodes (c)neighbors (d)all of above

14The time required in best case for search operation in binary tree is ____________. (a)O(n) (b)O(2n) (c)O(log n) (d)O( log 2n)

15Which of the following way follows in Post order traversal?

(7)

16A tree is a finite set of_________. (a)loops (b)domains. (c)functions. (d)nodes

17A tree is a data structure which represents hierarchical relationship between individual _________. (a)data items. (b)fields (c)nodes (d)linked list.

18In a directed tree any node which has out degree 0 is called a terminal node or__________. (a)a tree. (b)a list (c)a node. (d)a leaf

19In a directed tree if the ordering of the nodes at each level is prescribed then such a tree is called_______ tree.

(a)directed. (b)structure (c)ordered (d)degree of

20______________ a tree means processing it in such a way that each node is visited only once. (a)Traversing. (b)Implement. (c)Partition (d)Node

21The length of the path is the number of_____________ on the path (a)nodes. (b)fields (c)data (d)edges.

22The children node of same parent is called____________. (a)binary tree. (b)tree (c)sibling. (d)list

23Maximum degree in any vector in a graph with n vertices is ________. (a)n (b)n-1 (c)n+1 (d)2n+1

24The number of nodes in a complete binary tree of level 5 is__________. (a)15 (b)20 (c)63 (d)71

25A graph in which every edge is directed is called ________. (a)Digraph. (b)undirected graph. (c)directed edge (4)None

SECTION B (4 X 5=20) 1. Explain about threaded binary trees?

2. Short note on transitive closure.

3. Define binary tree.Explain its representation. 4. Write short notes on DFS and BFS.

5. Discuss array representation of binary tree with example. 6. Summarize about connected components.

SECTION C (10X1=10)) 1. Explain binary trees with appropriate pseudo code.

2. Narrate about several graph representations.

3. Explain the methods to determine the number of distinct binary trees having n nodes.

4. How do you find the minimum cost spanning tree using Kruskal’s algorithm? Explain with an algorithm?

(8)

Nehru Arts and Science College

Department of Information & Computer Technology Unit Test – 04 Date:

Reg. No: Name:

Subject: DATA STRUCTURES Class: II CT

Max Marks: 55 Duration:

SECTION A (25 X 1 = 25) 1.Base address is the address of __________.

(a)last element (b)first element. (c)middle element (4)pivot element 2Which of the following is collision resolution?

(a)Linear Probing. (b)Non linear probing (c)Collision procedure (d)Probing procedure 3In collision resolution the ratio ?=n/m is called__________.

(a)d factor. (b)load manager. (c)resolution factor. (4)collision factor.

4The possibility of two different keys k1 & k2 yielding the same hash address is called__________. (a)merge (b)obstacle (c)overlapping (d)collision

5Uniform distribution of the hash address throughout the given set L is __________. (a)reduce the number of collision. (b)increase the number of collision. (c)totally avoid collision. (d)manage address.

6__________involves maintaining two tables in memory. (a)Arranging (b)Bonding. (c)Combing (d)Chaining

7Clustering in linear probing increases_________________.

(a)average search time for a record. (b)usage of memory space. (c)collision. (d)average writing time. 8The complexity of searching an element from a set of n elements using Binary search algorithm is (a)O(n) (b)O(log n) (c)O(n2) (d)O(n log n)

9The goal of hashing is to produce a search that takes

(a)O(a)time (b)O(n2 ) time (c)O(log n ) time (d)O(n log n ) time

10A characteristic of the data that binary search uses but the linear search ignores is the___________. (a)Order of the elements of the list (b)Length of the list. (c)Maximum value in list. (d)Type of elements of the list.

11In order to get the contents of a Binary search tree in ascending order, one has to traverse it in (a)pre-order. (b)in-order. (c)post order. (d)not possible.

12In binary search, average number of comparison required for searching an element in a list if n numbers is

(a)log2 n (b)n / 2 (c)n (d)n – 1

13Which of the following is not the required condition for binary search algorithm? (a)The list must be sorted (b)there should be the direct access to the middle element in any sublist (c)There must be mechanism to delete and/or insert elements in list(d)none of above 14Binary search algorithm can not be applied to

(9)

15Which of the following is not a limitation of binary search algorithm?

(a)must use a sorted array (b)requirement of sorted array is expensive when a lot of insertion and deletions are needed (c)there must be a mechanism to access middle element directly (d)binary search algorithm is not efficient when the data elements are more than 1000

16A BST is traversed in the following order recursively: Right, root, left The output sequence will be in (a)Ascending order (b)Descending order (c)Bitomic sequence (d)No specific order

17Choose the correct statements

(a)Internal Sorting is used if the number of items to be sorted is very large (b)External Sorting is used if the number of items to be sorted is very large (c)External sorting needs auxillary storage (d)Internal sorting needs auxillary storage

18Sorting is useful for

(a)Report generation (b)Mininmizing the storage needed(c)Making searching easier and efficient (d)Responding to the queries easier

19The order of the binary search algorithm is (a)n (b)n2 (c)nlogn (d)logn

20A sorting technique that gurantees that records with the same primary key occurs in the same order in the sorted list as in the original unsorted list is said to be

(a)stable (b)Consistent (c)external (d)linear

21When new data are to be inserted into a datastructure, but there is no available space, this situation is usually called

(a)underflow (b)overflow (c)housefull (d)saturated

22_____________ is the advantage of chained hash table over the open addressing scheme. (a)worst case complexity of search operations is less. b. c. d. (b)space used is less. (c)deletion is easier (d)space used in high

23The average search time of hashing with linear probing will be less if the load factor ? (a)is far less than one (b)equals one (c)is far greater than one (d)none of above

24The searching technique that takes O (a)time to find a data is (a)Linear Search (b)Binary Search (c)Hashing (d)Tree Search 25Binary search is implemented

(a)static table and dynamic table (b)static table only(c)dynamic table only (d)none of the above

SECTION B (4 X 5=20) 1. Illustrate polyphase merge with an example.

2. Write a short note on midsquare nd folding methods in generating hashing. 3. Narrate about symbol tables.

(10)

SECTION C (10X1=10))

1. Explain the working procedure of magnetic tapes in detail. 2. Write a detailed note on overflow handling.

3. Elaborate on disk storage.

4. Classify the hashing functions and explain each with an example.

(11)

Nehru Arts and Science College

Department of Information & Computer Technology

Unit Test – 05 Date:

Reg. No: Name:

Subject: DATA STRUCTURES Class: II CT

Max Marks: 55 Duration:

SECTION A (25 X 1 = 25)

1.__________is combining the records in two different sorted files in to a single sorted file. (a)Sorting (b)Searching. (c)Listing. (d)Merging

2The complexity of merge sort algorithm is____________. (a)O(n) (b)O(log n). (c)O(n2) (d)O(n log n).

3Indexing is also called as ________________.

(a)matching. (b)elements. (c)pattern matching. (4)numbers.

4Which of the following sorting algorithm is of divide-and-conquer type? (a)Bubble sort. (b)Insertion sort. (c)Quick sort. (4)Algorithm.

5Which of the following statements is true I.As the number of entries in the hash table increases, the number of collision increases II.Recursive programs are efficient III.The worst time complexity of quick sort is O(n2) IV.Binary search using a linked list is efficient

(a)I and II (b)II and III (c)I and IV (d)I and III 6Quick sort algorithm uses ______ technique.

(a)Dynamic programming. (b)Backtracking (c)Divide and Conquer (d)Greedy Method 7Quick sort uses ____ for implementation.

(a)recursion. (b)traversal. (c)heaps. (d)queues.

8What is the worst-case time for heap sort to sort an array of n elements? (a)O(log n). (b)O(n) (c)O(n log n) (d)O(n²).

9For the heap sort, access to nodes involves simple _______________ operations. (a)binary. (b)arithmetic (c)algebraic (d)logarithmic

10Which of the following sorting methods would be most suitable for sorting a list which is almost sorted (a)Bubble Sort (b)Insertion Sort (c)Selection Sort (4)Quick Sort

11The best average behaviour is shown by

(a)Quick Sort (b)Merge Sort (c)Insertion Sort (d)Heap Sort 12Which of the following sorting algorithm is stable (a)insertion sort. (b)bubble sort. (c)quick sort. (d)heap sort 13The worst case of quick sort has order

(a)O(n2) (b)O(n) (c)O (n log2 n) (d)O (log2 n) 14In a Heap tree

(a)Values in a node is greater than every left sub tree and smaller than right sub tree (b)Values in a node is greater than every value in a children of it (c)Both of the above conditions applies (d)None of the above conditions applies

(12)

16Pick the correct statement

(a)Sequential file organization is suitable for batch processing (b)Sequential file organization is suitable for interactive processing (c)Indexed sequential file organization supports interactive

processing (d)Relative file can’t be accessed sequentially

17As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be ?

(a)Bubble sort (b)Insertion sort (c)Selection sort (4).Heap sort

18The way a card game player arranges his cards as he picks them up one by one, is an example of ? (a)bubble sort (b)selection sort (c)insertion sort (4)merge sort

19A machine needs a minimum of 100 sec to sort 1000 names by quick sort.The minimum time needed to sort 100 names will be approximately ?

(a)50.2 sec (b)6.7 sec (c)72.7 sec (d)11.2 sec 20Which of the following is not the internal sort?

(a)Insertion Sort (b)Bubble Sort (c)Merge Sort (d)Heap Sort 21Time is O(n log n) and sorting is stable

(a)Selection sort (b)Insertion sort (c)Quick sort (4)Merge sort

22A combination of key values specified for retrieval will be termed as a ---(a)query (b)key (c).index (d)hash

23Inverted file is a

(a)File organization (b)File access (c)File query (d)File sorting 24File is a collection of

(a)pointers (b)data (c)records (d)none of the above 25A directory is a collection of

(a)records (b)indexes (c)keys (d)none of the above

SECTION B (4 X 5=20) 1. With a neat sketch, explain inverted files organization?

2. Discuss the recursive formulation of merge sort. 3. Write a short note on files.

4. List out various internal sorting methods.Explain shell sort. 5. Write about heap sort with suitable example.

SECTION C (10X1=10)) 1. Write a detailed note on tree indexing- B trees.

2. Write down procedure for insertion sort and explain it with an example. 3. Explain in detail about cylinder-surface indexing.

4. Explain the quick sort algorithm.

5. List out various file organizations.Write about linked organizations.

References

Related documents

A) She should first revise the Gantt chart with new timelines. B) She should initially contact the steering committee and begin with a new team. C) She should first show

Q-5 (B) list the important features of RISC processor Q-6 (A) Write short notes on “Memory interleaving” Q-6 (B) SUNSPARC Architecture.. Q-6 (C) RISC Characteristics Q-6 (D) power

In the given political outline map of Europe, four member countries of the European Union have been marked A, B, C and D.. Identify them with the help of information given below and

Match List-I (Deposit) with List-II (Soil structure) and select the correct answer using the codes given below the listsC. Lis

(a) Indian Railways Council for Advanced Material Technology (b) Indian Railways Committee for Advanced Material Technology (c) Indian Railways Centre for Advanced Material

90) For horn surgery in goat nerve to be blocked a) cornual nerve. b) infratrochlear nerve c) cornual nerve

Which of the following preachers does Matthew Arnold quote as saying “To make reason and the will of God prevail!”. (A) Bishop Wilson (B) Bishop Temple (C) Bishop Benson (D)

59. The work output of theoretical Otto cycle a) increases with increase in compression ratio b) increases with increase in pressure ratio c) increases with increase in