Unit - I Arrays and Linked List: Siddharth Group of Institutions:: Puttur
Unit - I Arrays and Linked List: Siddharth Group of Institutions:: Puttur
UNIT –I
UNIT 2
UNIT 3
1. Explain insertion and deletion of a new element in height balanced tree. [10M][L5]
2. Write Warshsall’s Algorithm for Shortest path problem and give an example [10M][L6]
3. Discuss the different Traversal Operations on a Binary Tree with Algorithms [10M][L4]
4. A. What are the advantages and disadvantages of sequential representation of a binary tree?
[10M][L4]
B. Write an algorithm to search an element in binary search tree? [10M][L6]
5. Construct AVL Tree using “8,9,10,2,1,5,6,4,7,11,12,3” elements inserting in sequence[10M][L3]
6. Illustrate heap sort technique using heap trees. [10M][L4]
7. A. In how many ways we can represent a graph? [5M][L4]
B. Explain about applications of graph [5M][L5]
8. Write BFS algorithm and illustrate it with an example. [10M][L6]
9. Write DFS algorithm and illustrate it with an example. [10M][L6]
10. Write an algorithm to insert elements into a binary search tree. [10M][L6]
UNIT – IV
SORTING
1. Explain in detail the following with an example
a) Straight Insertion sort [5M][L5]
B. List insertion sort [5M][L5]
2. Write and explain the algorithm for bubble sort with example. [10M][L6]
3. A. Give the classification of sorting methods. [5M][L6]
DATA STRUCTURES Page 3
QUESTION BANK 2016
UNIT – V
SEARCHING
1. State and explain sequential sort algorithm with example problem. [10M][L1&L5]
2. State and explain binary sort algorithm with problem. [10M][L1&L5]
3. Define hashing and explain any four Hashing Methods with example. [10M][L1&L5]
4. A. What is hashed list search? [5M][L4]
B. Explain Linked list collision resolution method. [5M][L5]
5. A. Give the detail about bucket hashing. [5M][L6]
B. Write about the different folding methods. [5M][L6]
6. Explain the following. [3+3+4=10M][L5]
A. Key offset
B. Digit extraction method
C. Pseudorandom Collision Resolution
7. Perform Binary search method to find 22 from the following sorted array. [10M][L3]
4,7,8,10,14,21,22,36,62,77,81,91
8. Give the logics behind linear and binary search methods. [10M][L6]
9. Explain collision resolution. [10M][L5]
10. Explain Fibonacci search using an example. [10M][L5]
11. a) What are self-referential structures? [2M][L4]
UNIT 1
UNIT 2
1. Stack is a [ ]
A. LIFO B. FIFO C. FILO D. LILO
2. Disks piled up one above the other represent a [ ]
A. Stack B. Queue C. Linked List D. Array
3. Reverse Polish notation is the other name of [ ]
A. Infix expression B. Prefix expression C. Postfix expression D. Algebraic expression
4. Using a recursive function takes more memory and time to execute. [ ]
A. true B. false C. can’t predict D. may be
5. The following sequence of operations is performed on a stack push(1), push(2), pop, push(1),
push(2), pop, pop, pop, push(2),pop. The sequence of the popped out values is [ ]
A. 2, 2, 1, 1, 2 B. 2, 2, 1, 2, 2 C. 2, 1, 2, 2, 1 D. 2, 1, 2, 2, 2
6. Infi nite recursion occurs when [ ]
A. a base case is omitted B. a base case is never reached
C. both A. and B. D. none of the above
7. The data structure used for recursion is [ ]
A. stack B. queue C. tree D. none of the above
8. A line in a grocery store represents a [ ]
A. Stack B. Queue C. Linked List D. Array
9. In a queue, insertion is done at [ ]
A. Rear B. Front C. Back D. Top
10. The function that deletes values from a queue is called [ ]
A. enqueue B. dequeue C. pop D. peek
11.The size of a linked queue cannot change during run time. [ ]
A. true B. false C. can’t predict D. may be
12. A queue is also called a [ ]
DATA STRUCTURES Page 8
QUESTION BANK 2016
A. last in first out data structure B. first in last out data structure
C. first in first out data structure D. last in last out data structure
13. in a hash table, an element with key k is stored at index [ ]
A. k B. log k C. h(k) D. k2
14. In any hash function, M should be a [ ]
A. Prime number B. Composite number C. Even number D. Odd number
15. In which of the following hash functions, do consecutive keys map to consecutive hash values?
[ ]
A. Division method B. Multiplication method
C. Folding method D. Mid-square method
16. The process of examining memory locations in a hash table is called [ ]
A. Hashing B. Collision C. Probing D. Addressing
17. Which open addressing technique is free from clustering problems? [ ]
A. Linear probing B. Quadratic probing C. Double hashing D. Rehashing
18.A queue in which both insertions and deletions are possible at both ends is called [ ]
A.Dequeue B.Deq C.Deque D.Dique
19.A Queue in which elements are inserted and deleted based on it’s priority are called [ ]
A.Priority queue B.preference queue C.Deque D.circular queue
20.when do you say “a stack is full”? [ ]
A.top=size B.top==size C.top=size+1 D.none
21. Which data structures don’t obey FIFO strategy ? [ ]
A.array B.stack C.linked list D.none
22. Which of the following implementation of priority queue is efficient? [ ]
A.multi-queue B.circular queue C.single linked list D.double linked list
23. A queue in which elements are inserted and deleted based on priority is called [ ]
A.important queue B.circular queue C.priority queue D.none
24. Which of the following symbol is pushed onto the stack before converting a parenthesized
expression to postfix expression? [ ]
A.’{‘ B.’)’ C.’(‘ D.’}’
25.CPU uses which of the following data structures during execution of multiple programs at a time.
[ ]
A.stack B.queue C.tree D.array
26. When we consider starting index of queue is “ 0”.then which of the following conditions are used
to chech “queue full” condition? [ ]
A.rear=length B.rear==length C.rear==(length-1) D.none
27. How many minimum number of moves are needed to transfer 5 disks on a source tower to
destination tower? [ ]
A.8 B.30 C.32 D.31
28.In which of the following data structures insertion is not possible in the middle? [ ]
A.array B.linked list C.stack D.none
29.During recursive function calls computer utilizes? [ ]
A.queue B.array C.stack D.linked list
30.which of the following operations is not possible in input-restricted deque? [ ]
A.deletion at front B.insertion at front C.deletion at rear D.insertion at rear
31.which of the following operations is not possible in output-restricted deque? [ ]
A.deletion at front B.insertion at front C.deletion at rear D.insertion at rear
32.In multiple-queues with matrix representation of priority queue rows represent? [ ]
A.length of every queue B.priority
C.element count D.none
33.What is dynamic stack? [ ]
UNIT 3
1. In Binary Search if the Search element is greater than the mid then the condition is [ ]
A. low = mid +1 B. high = mid-1 C. mid = (low+high)/2 D. None
2. The Binary Search Algorithms needs theelements to be in ________ Order [ ]
A. Ascending B. Random C. Both D. None
3. BFS makes use of __________ [ ]
A. Stack B. Queue C. List D. Heap
4. DFS makes use of __________ [ ]
A. Stack B. Queue C. List D. Heap
5. Topological Sorting is possible only with _____________ [ ]
A. DAGs B. Directed Graphs C. Cyclic Graphs D. All
6. A Graph where each vertex is connected to all other vertices is called____ [ ]
A. Completely Connected B. Directed Graphs C. Cyclic Graphs D. All
7. All Trees are ________ [ ]
A. Binary Trees B. Arrays C. Graphs D. Heaps.
8. In an M-ary Tree with M value as 2 is called as ______ Tree [ ]
A. Binary B. 3-ary Tree C. Skewed Tree D. Full Binary Tree
9. In _________ Binary tree all the leaf nodes will be all the same level [ ]
A. Complete B. Full C. Skewed D. All
10. __________ are height balanced trees. [ ]
A. AVL B. Red-Black C. Splay Trees D. B-Trees
11. In a Complete Binary Tree if a Node is at index I then its root is at _______ [ ]
A. i/2 B. 2I C. 2I+1 D. 2I+2
12. In a Complete Binary Tree if a Node is at index I then its left child is at ___ [ ]
A. i/2 B. 2I C. 2I+1 D. 2I+2
13. In a Complete Binary Tree if a Node is at index I then its right child is at ___ [ ]
A. i/2 B. 2I C. 2I+1 D. 2I+2
14. A binary tree is generated by inserting an inorder as 50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24. The
number of nodes in the left and right subtree, respectively is given by [ ]
A. (4, 7) B. (7, 4) C. (8, 3) D. (3, 8)
15. A BST contains the values 1, 2, 3, 4, 5, 6, 7, 8. The tree is traversed in preorder and the values
are printed. The valid output is [ ]
A. 53124786 B. 53126487 C. 53241678 D. 53124768
16. In _________ traversal, the right subtree is processed last. [ ]
A. a preorder B. an inorder C. a postorder D. A. or B.
17. Which of the following traversal techniques lists the nodes of a BST in ascending order?
[ ]
A. Postorder B. Inorder C. Preorder D. All of a, b, c
18. A binary tree has a height of 5. What is the minimum number of nodes it can have? [ ]
A. 31 B. 15 C. 5 D. 1
19.A list of integers is read one at a time, and a BST is constructed. Next, the tree is traversed and the
integers are printed. Which traversal would print the result in the original order of the input?
[ ]
A. Preorder B. Postorder C. Inorder D. None of the above
20.A binary tree T h as n leaf nodes. The number of nodes of degree 2 in T is [ ]
A. log2 n B. n – 1 C. n D. 2n
21. A binary tree where every non-leaf node has non-empty left and right subtrees is called a
strictly binary tree. Such a tree wi th 10 leaves [ ]
A. cannot have more than 19 nodes.
B. has exactly 19 nodes.
C. has exactly 17 nodes.
D. cannot have more than 17 nodes.
22. An edge that has identical end-points is called a [ ]
A. Multi-path B. Loop C. Cycle D. Multi-edge
23. The total number of edges containing the node u is called [ ]
A. In-degree B. Out-degree C. Degree D. None of these
24. A graph in which there exists a path between any two of its nodes is called [ ]
A. Complete graph B. Connected graph C. Digraph D. In-directed graph
25. The number of edges that originate at u are called [ ]
A. In-degree B. Out-degree C. Degree D. source
26. The number of distinct simple graphs with upto 3 nodes is [ ]
A. 15 B. 10 C. 7 D. 9
27. 9. Which is the most appropriate matching for the following pairs? [ ]
X: depth-first search 1: heap
Y: breadth-first search 2: queue
Z: sorting 3: stack
A. X–1, Y–2, Z–3 B. X–3, Y–1, Z–2 C. X–3, Y–2, Z–1 D. X–2, Y–3, Z–1
28.elements arranged in hierarchical fachion is called [ ]
A.tree B.graph C.array D.linked list
UNIT 4
SORTING
21) Finding the location of a given item in a collection of items is called ______ [ ]
A. Discovering B. Finding C. Searching D. Mining
22) Which of the following is an external sorting? [ ]
A. Insertion Sort B. Bubble Sort C. Merge Sort D. Tree Sort
23) Very slow way of sorting is _______ [ ]
A. Insertion sort B. Heap sort C. Bubble sort D. Quick sort
24) Which of the following is an internal sorting? [ ]
A. Tape Sort B. 2-way Merge Sort C. Merge Sort D. Tree Sort
25) Sorting a file F usually refers to sorting F with respect to a particular key called _____
[ ]
A. Basic key B. Primary key C. Starting key D. Index key
26) The time complexity of quick sort is ________ [ ]
A. O(n) B. O(logn) C. O(n2) D. O(n logn)
27) Selection sort first finds the .......... element in the list and put it in the first position.
[ ]
A. Middle element B. Largest element C. Last element D. Smallest element
28) Quick sort is also known as _________ [ ]
A. merge sort B. tree sort C. shell sort D. partition and exchange sort
29) The operation that combines the element is of A and B in a single sorted list C with n=r+s element
is called __________ [ ]
A. Inserting B. Mixing C. Merging D. Sharing
30) A tree sort is also known as _____ sort. [ ]
A. quick B. shell C. heap D. selection
31) _______ sorting is good to use when alphabetizing large list of names. [ ]
A. Merge B. Heap C. Radix D. Bubble
32) The easiest sorting is _______ [ ]
A. quick sort B. shell sort C. heap sort D. selection sort
33) Which of the following sorting algorithm is of divide and conquer type? [ ]
A. Bubble sort B. Insertion sort C. Quick sort D. Merge sort
34) Merging k sorted tables into a single sorted table is called ______ [ ]
A. k way merging B. k th merge C. k+1 merge D. k-1 merge
35) The function used to modify the way of sorting the keys of records is called [ ]
A. Indexing function B. Hash function
C. Addressing function D. All of the above
36) If the number of record to be sorted large and the key is short, then _____ sorting can be efficient.
[ ]
A. Merge B. Heap C. Radix D. Bubble
37) The total number of comparisons in a bubble sort is ______ [ ]
A. O(n logn) B. O(2n) C. O(n2) D. O(n)
38) If the number of record to be sorted large and the key is long, then _____ sorting can
be efficient. [ ]
A. Merge B. Heap C. Quick D. Bubble
39) The time complexity of heap sort is _______ [ ]
A. O(n) B. O(logn) C. O(n2) D. O(n logn)
40) The complexity of selection sort is _______ [ ]
A. O(n) B. O(n2) C. O(n logn) D. O(logn)
UNIT 5
SEARCHING
15.The Complexity of searching an element form a set n elements using Binary Search algorithm is
[ ]
A.O(n2) B.O(log n) C.O(n2) D.O(n log n)
16.The worst case occur in linear search algorithm when [ ]
A. Item is somewhere in the middle of the array
B. Item is not in the array at all
C. Item is the last element in the array
D. Item is the last element in the array or item is not there at all
17. The Average case occurs in linear search algorithm [ ]
A. when item is somewhere in the middle of the array
B.when item is not the array at all
C. when item is the last element in the array
D. Item is the last element in the array or item is not there at all
18. In_____,Search start at the beginning of the list and check every element in the list
[ ]
A. Linear search B. Binary search C. Hash Search D. Binary Tree search
19. If h is any hashing function and is used to hash n keys in to a table of size m,
where n<=m, the expected number of collisions involving a particular key x is [ ]
A. less than 1 B. less than n C. less than m D. less than n/2
20. A mathematical-model with a collection of operations defined on that model is called
[ ]
A. Data Structure B. Abstract Data Type
C. Primitive Data Type D. Algorithm
21. A technique for direct search is [ ]
A. Binary Search B. Linear Search C. Tree Search D. Hashing
22. The searching technique that takes O (1) time to find a data is [ ]
A. Linear Search B. Binary Search C. Hashing D. Tree Search
23.The 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)
24.The goal of hashing is to produce a search that takes [ ]
A. O(1)time B. O(n2)time C. O(log n )time D. O(n log n )time
25. A 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
26. Which of the following case does not exist in complexity theory? [ ]
A. Best case B. Worst case C. Average case D. Null case
27. The worst case occur in linear search algorithm when [ ]
A. Item is somewhere in the middle of the array
B. Item is not in the array at all
C. Item is the last element in the array
D. Item is the last element in the array or is not there at all
28. The average case occur in linear search algorithm when [ ]
A. Item is somewhere in the middle of the array
B. Item is not in the array at all
C. Item is the last element in the array
D. Item is the last element in the array or is not there at all
29. The complexity of linear search algorithm is [ ]
A. O(n) B. O(log n) C. O(n2) D. O(n log n)
30. The complexity of binary search algorithm is [ ]
Which one of the following choices gives a possible order in which the key values could have been
inserted in the table? [ ]
A. 46, 42, 34, 52, 23, 33
B. 34, 42, 23, 52, 33, 46