0% found this document useful (0 votes)
88 views

TechDataStructuresSamplePaper (50questions)

The document contains 50 multiple choice questions about data structures. The questions cover topics like time complexity of searching in a hash, data structure representations, binary trees, graphs, sorting algorithms, stacks, queues, linked lists, and more. Answer options with the correct answer highlighted are provided for each question.

Uploaded by

RIDDHI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views

TechDataStructuresSamplePaper (50questions)

The document contains 50 multiple choice questions about data structures. The questions cover topics like time complexity of searching in a hash, data structure representations, binary trees, graphs, sorting algorithms, stacks, queues, linked lists, and more. Answer options with the correct answer highlighted are provided for each question.

Uploaded by

RIDDHI
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Data Structures

Data Structures Sample Paper page 1 of 8

Data Structures Sample Paper

1. Time Complexity of searching an element in hash is


(1) O(n)
(2) O(1)
(3) O (nlogn)
(4) O (logn)

2. Data structure representation in memory is know as:


(1) recursive
(2) abstract data type
(3) storage structure
(4) file structure

3. The Process Control Block is :


(1) Process type variable
(2) Data Structure
(3) a secondary storage section
(4) a Block in memory

4. Root is processed first in


(1) Postorder traversal
(2) Preorder Traversal
(3) Inorder Traversal
(4) None of above.

5. Which traversal prints the data in sorted order in Binary search tree ?
(1) Postorder traversal
(2) Preorder Traversal
(3) Inorder Traversal
(4) None of above.

6. In a BST the root element data is :


(1) lesser than the data of elements in left subtree
(2) greater than or equal to the data of elements in left subtree .
(3) greater than or equal to the data of elements in Right Subtree.
(4) None of above.

7. Which of the following is a property of minheap?


(1) Root element is equal to its child elements
(2) Root element is greater than its child elements
(3) Root element is lesser than its child elements

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 2 of 8

(4) None of above.

8. Convert "w*x-y+z" to Prenotation form.


(1) -*wx+yz
(2) -*+wxyz
(3) -w*xy+z
(4) *wx-+yz

9. The height of a binary tree is


(1) MAX( Height of left Subtree, Height of right subtree)+1
(2) MAX( Height of left Subtree, Height of right subtree)
(3) MAX( Height of left Subtree, Height of right subtree)-1
(4) None of the options

10. The parameters on which an algorithm's efficiency is measured are


(1) Time and Capacity complexity
(2) Time and Space complexity
(3) Speed and Space complexity
(4) Speed and Capacity complexity

11. A heap is a particular kind of a binary search tree


(1) true
(2) false
(3) Ambiguous Statement
(4) None of the options

12. LIFO ordering is present in


(1) Queue
(2) Stack
(3) Vector
(4) ArrayList

13. Worst time complexity for Bubble sort is


(1) O(n)
(2) O(logn)
(3) O(n^2)
(4) O(1)

14. Which is true about Kadane's Algorithm ?


(1) Maximum product subsequence in an array
(2) Maximum sum Subarray in an array
(3) Maximum product subsequence in an array
(4) None of the above

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 3 of 8

15. The advantage of adjacency list representation over adjacency matrix in graph representation?
(1) Adding a vertex in adjacency list representation is much easier tha adjacency matrix
(2) DFS and BSF take much lesser time adjacency list representation.
(3) Space is saved for sparse graphs in adjacency list representation,
(4) All of the above

16. Sum of the degrees of all vertices with V vertices and E edges in undirected graph is
(1) 2E
(2) V+E
(3) 2V
(4) V

17. Using Bubble Sort, how many interchanges required to sort an int array containing "15, 10, 26,
12, 14" in ascending order :
(1) 2
(2) 4
(3) 5
(4) 6

18. A linear list in which insertion can only happen from end of the list and deletion can only happen
from the very start of the list, is called ?
(1) queue
(2) stack
(3) tree
(4) linked list

19. A linear list in which insertion and deletion can only happen from very end of the list, is called ?
(1) queue
(2) stack
(3) tree
(4) linked list

20. Breadth First Traversal uses which Datastructure?


(1) tree
(2) queue
(3) array
(4) stack

21. what kind of tree infix form will be always sorted?


(1) binary tree
(2) avial tree
(3) balanced tree
(4) binary search tree

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 4 of 8

22. What is the costly operation in singly linked list?


(1) inserting the element in the begning
(2) deleting the entry from the begning
(3) insert the element exactly in the middle of the linked list
(4) All

23. Which data structure can be used to check whether parenthesis are balanced or not
(1) tree
(2) queue
(3) array
(4) stack

24. best data structure to implement recursion?


(1) tree
(2) queue
(3) array
(4) stack

25. Which data structure works as FIFO


(1) stack
(2) queue
(3) array
(4) tree

26. Number of stacks required to implement queue is?


(1) 2
(2) 3
(3) 4
(4) 1

27. which heap stores the maximum element on the root?


(1) min heap
(2) max heap
(3) node heap
(4) none

28. Minimum no of spanning trees in a graph


(1) 0
(2) 1
(3) 2
(4) 3

29. DS to check balanced paranthesis


(1) stack

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 5 of 8

(2) queue
(3) list
(4) tree

30. Which traversal algorithm gives the sorted order in binary search tree?
(1) level order
(2) pre order
(3) post order
(4) in order

31. Which of the following is not a application of stack


(1) Balancing of symbols
(2) CPU sheduling and disk sheduling
(3) Infix to postfix/Prefix conversion
(4) Forward and backword features in web browsers

32. An input restricted dequeue is a linear list in which items may be inserted at one end but
removed from either end. Such a data structure can be operated
(1) neither as a queue nor as a stack
(2) as a queue but not as a stack
(3) as a stack but not as a queue
(4) both as a queue and as a stack

33. Which of the following linked lists cannot contain NULL links?
(1) Single linked list
(2) Linear doubly linked list
(3) Circular linked list
(4) None of the above

34. A connected graph without any cycle is called?


(1) free tree
(2) tree
(3) Both A and B
(4) None of the above

35. The optimal way of calculating longest common subsequence in string has time complexity :
(1) O(n^3)
(2) O(n)
(3) O(n^2)
(4) None of the above

36. Let us suppose there are two strings s1 and s2 and operations :1. Insert 2. Remove 3.Replace
can be performed on s1. Calculate the number of operations that are needed to convert s1 into s2
of length m and n respectively

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 6 of 8

(1) O(m)
(2) O(n)
(3) O(m*n)
(4) O(m^2*n)

37. Which of the following is not a stable stable sorting algorithm


(1) Insertion sort
(2) Quick sort
(3) Merge sort
(4) Bubble sort

38. Time complexity for finding intersection point in two linked lists of length n1 and n2 is :
(1) O(n1+n2)
(2) O(n1 + n2)log(n1+n2)
(3) O(n1^2 + n2^2)
(4) None of the above

39. Time complexity for finding k largest elements in array of length n(optimally ) is :
(1) O(n + klogk)
(2) O(k + nlogk)
(3) O(k + (n-k)logk)
(4) None of the above

40. Stack data structure has the following principle


(1) LIFO
(2) FIFO
(3) FILO
(4) LILO

41. Queue data structure has the following principle


(1) LIFO
(2) FIFO
(3) FILO
(4) LILO

42. Time complexity of finding majority element (element appearing maximum number of times ) in
an array of length n is :
(1) O(n ^ 2)
(2) O(n)
(3) O(n ^ 3)
(4) None of the above

43. The space complexity(most efficient) for finding maximum product subarray in an array of
length n is :

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 7 of 8

(1) O(n)
(2) O(1)
(3) O(logn)
(4) None of the above

44. Which data types are used only for positive values in data structure?
(1) Signed
(2) Arrays
(3) Unsigned
(4) Boolean

45. A singed character range is


(1) 0-255
(2) `-128 to +127`
(3) `-128 to 128`
(4) 0-256

46. What is the minimum number of nodes that a binary tree can have?
(1) 0
(2) 1
(3) 2
(4) 3

47. Stack uses which principle


(1) FIFO
(2) FCFO
(3) LCFO
(4) LIFO

48. What is a de-queue?


(1) Distributed Ended Queue
(2) Dynamic Ended Queue
(3) Double Elongated Queue
(4) Double Ended Queue

49. Select a part of a linked list


(1) Head
(2) Stack
(3) Queue
(4) List

50. Which data structure is a non-linear data structure?


(1) arrays
(2) linked lists

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Data Structures Sample Paper page 8 of 8

(3) queues
(4) trees

Prepare for MBA, Law, Software Engineering and many more...


Brought to you by EduThrill
Answer Key

1. (2) O(1)
2. (2) abstract data type
3. (2) Data Structure
4. (2) Preorder Traversal
5. (3) Inorder Traversal
6. (2) greater than or equal to the data of elements in left subtree .
7. (3) Root element is lesser than its child elements
8. (1) -*wx+yz
9. (1) MAX( Height of left Subtree, Height of right subtree)+1
10. (2) Time and Space complexity
11. (2) false
12. (2) Stack
13. (3) O(n^2)
14. (2) Maximum sum Subarray in an array
15. (4) All of the above
16. (1) 2E
17. (3) 5
18. (1) queue
19. (2) stack
20. (2) queue
21. (4) binary search tree
22. (3) insert the element exactly in the middle of the linked list
23. (4) stack
24. (4) stack
25. (2) queue
26. (1) 2
27. (2) max heap
28. (2) 1
29. (1) stack
30. (4) in order
31. (2) CPU sheduling and disk sheduling
32. (4) both as a queue and as a stack
33. (3) Circular linked list
34. (3) Both A and B
35. (3) O(n^2)
36. (3) O(m*n)
37. (2) Quick sort
38. (1) O(n1+n2)
39. (3) O(k + (n-k)logk)
40. (1) LIFO
41. (2) FIFO
42. (2) O(n)
43. (2) O(1)
44. (3) Unsigned
45. (2) `-128 to +127`
46. (1) 0
47. (4) LIFO
48. (4) Double Ended Queue
49. (1) Head
50. (4) trees

You might also like