Data Structure and Algorithm Past Questions and Answers

  

                       

 This post contains a question bank in the form of true/false, fill in the blanks and MCQ questions on the topic of Data Structure and Algorithm.


QUIZ 1

1. Which of the following is true about the characteristics of abstract data types? i) It exports a type or value, ii) IT exports a set of operations

Select one:

a. True, True

b. False, True

c. True, False

d. False, False

 

ANSWER:     A

2. Stack allows insertion and deletion at one end called.

Select one:

a. Down

b. Rear

c. Front

d. Top

 

ANSWER:     D

3. Doubly linked list are also called as.

Select one:

a. Two-way list

b. Double - way list

c. Dual - way list

 

ANSWER:     A

4. ……………… is called as a list of finite number of elements of similar data types.

Select one:

a. Pointers

b. Linked list

c. Array

d. Stack

 

ANSWER:     C

5. Specify the method for deleting an element from the queue.

Select one:

a. Deque

b. Enqueue

c. Dequeue

 

ANSWER:     C

6. ………………… is a linear collection of nodes.

Select one:

a. Stack

b. Linked list

c. Heap

 

ANSWER:     B

7. Tree is a non-linear data structure state.

Select one:

a. True

b. False

 

ANSWER:     A

8. ……………..is very useful in situations when data is to be stored and then retrieved in the reverse order.

Select one:

a. List

b. Queue

c. Stack

d. Linked list

 

ANSWER:     C

9. Insertion and deletion of element in queue are done in ………………….and………….. ends respectively.

Select one:

a. Last and First

b. Front and Rear

c. Rear and Front

 

ANSWER:     C

10. ..........................technique is used to collect all the free cells and store in free pool.

Select one:

a. Garbage Collection

b. Trash Collection

c. Bin Collection

 

ANSWER:     A

11. ………………….is used to store the unused memory cells.

Select one:

a. Free-storage list

b. Contiguous memory

c. Garbage memory

 

ANSWER:     A

 

12. ………………………. In a priority queue, insertion and deletion takes place at?

Select one:

 a. only at rear

b. any position

c. only at the front

d. front, rear end

 

ANSWER:     B

13. Before every insertion into the stack ……………………… condition need to be checked.

Select one:

a. PREFLOW

b. UNDERFLOW

C. OVERFLOW

 

ANSWER:     C

14. When does the Top value of the stack changes

Select one:

a. after deletion

b. at the time of deletion

c. while checking underflow

d. before deletion

 

ANSWER:     A

15. Breadth first search algorithm uses a ………………………. data structure to perform the search.

Select one:

a. Linked-list

b. Tree

c. Hashes

d. Queue

 

ANSWER:     D

16. Addition is having higher precedence than Multiplication state.

Select one:

a. False.

b. True

 

ANSWER:     A

17. Which of the following is not the part of ADT description?

Select one:

a. Both A & B

b. Data

c. None of the above

d. Operations

 

ANSWER:     C

18. New node can be availed from ………………………list while inserting new element into the queue.

Select one:

a. AVAIL

b. GARBAGE

c. FREE

 

ANSWER:     A

19. Match the following:

a) Completeness b) Time Complexity c) Space Complexity

i) How long does it take to find a solution? ii) How much memory is needed to perform the search? iii) Is the strategy guaranteed to find a solution when there is one?

Select one:

a. a-iii, b-i, c-ii

b. a-i, b-iii, c-ii

c. a-i, b-ii, c-iii

d. a-iii, b-ii, c-i

 

ANSWER:    A

 

20. A  ……………………is a data structure that organizes data similar to a line in the suppermarket, where the first one in the line is the first one out.

Select one:

a. Pointers

b. Stacks linked list

c. Records

d. Queue linked list

 

ANSWER:     D 

21. Which of the following is/are the levels of implementation of data structure?

Select one:

a. All of the above

b. Application level

c. Abstract level

d. Implementation level

 

ANSWER:     A

22. ________and _______ are the two pointers that are used in queue.

a. TOP and REAR

b. FRONT and TOP

c. FRONT and REAR

 

ANSWER:     C

23. _______and _______ are types of linked list.

Select one:

a. Priority and Circular linked list

b. Ordinary and Singly linked list

c. Doubly and Circular linked list

 

ANSWER:     C

 

24. In incidence matrix, If the kth edge is (vi, vj) then the kth column has a value____in the ith row...... in the jth row and …….…....... elsewhere.

Select one:

a. 1,-1,0

b. 0,-1,110.

c. 0,1,-1

d. -1,1,0

 

ANSWER:     A

25. In a directed graph, the .......................of a vertex v is the number edges of leaving v, and its ...............is the number of edges ending at v.

Select one:

a. degree, edges

b. out-degree, in-degree

c. edges, degree

d. in-degree, out-degree

 

ANSWER:     B

26. The ........ of the algorithm is depending on the time and space it uses.

Select one:

a. Efficiency

b. Compplexity

c. Thoroughput

d. Performance

 

ANSWER:     A

27. ................technique is used to collect all the free cells and store in free pool.

Select one:

a. Garbage Collection

b. Trash Collection

c. Bin Collection

 

ANSWER:     A

28. Tree is a non-linear data structure state.

Select one:

a. False

b. True

 

ANSWER:     B

29. P+Q and (X+Y)* Z is the........................expression.

Select one:

a. Infix

b. Prefix

c. Postfix

 

ANSWER:     A

30. Insertion and deletion of element from the stack is performed with ….......... and ............... operation.

Select one:

a. Postfix and Prefix

b. Pop and Push

c. Push and pop

 

ANSWER:     C

31. Breadth first search algorithm uses a..........data structure to perform the search.

Select one:

a. Tree

b. Queue

c. Hashes

d. Linked-list

 

ANSWER:     B

32. Processing each node of linked list exactly once is called as.

Select one:

a. Triangulating

b. Traversing

c. Searching

 

ANSWER:     B

33. A _____ is a data structure that organizes data similar to a line in the suppermarket, where the first one in the line is the first one out.

Select one:

a. Stacks linked list

b. Queue linked list

c. Records

d. Pointers

 

ANSWER:     B

34. ...........is called as a list of finite number of elements of similar data types.

Select one:

a. Stack

b. Array

c. Pointers

d. Linked list

 

ANSWER:     B

35.  ..........and.........are the two fields of linked list.

Select one:

a. Graph field

b. Data and Link fields

c. Data and Joint Field

 

ANSWER:     B

36. Which one of the below mentioned is linear data structure -

Select one:

a. Arrays

b. All of the above

c. Stack

d. Queue

 

ANSWER:     B

37. The data structure which contains the hierarchical relationship between various elements is called a.

Select one:

a. Array

b. Queue

c. Tree

d. Graph

 

ANSWER:     C

38. ……….. is used in combining the records in two different files into a single file.

Select one:

a. Prunning

b. Concatenating

c. Traversing

d. Merging

 

ANSWER:     D

39. In a priority queue, insertion and deletion takes place at?

Select one:

a. only at the front

b. front, rear end

c. any position

d. only at rear

 

ANSWER:     C

40. Doubly linked list are also called as.

Select one:

a. Double-way list

b. Two-way list

c. Dual - way list

 

ANSWER:     B

41. The head node can be deleted from Doubly Linked List.

Select one:

a. False

b. True

 

ANSWER:     A

42. Which of the following is not a non-linear data structure?

Select one:

a. Binary Tree

b. Graphs

c. Trees

d. Stacks

 

ANSWER:     D

43. Stack allows insertion and deletion at one end called.

Select one:

a. Top

b. Down

c. Front

d. Rear

 

ANSWER:     A

44. When does the Top value of the stack changes

Select one:

a. at the time of deletion

b. before deletion

c. while checking underflow

d. after deletion

 

ANSWER:     D

45. ........is a pile in which items are added at one end and removed from the other

Select one:

a. None of the above

b. List

c. Queue

d. Stack

 

ANSWER:     C

46. Which of the following is not a component of data structures?

Select one:

a. Storage Structure

b. Algorithms

c. None of the above

d. Operations

 

ANSWER:     C

47. .........is used to find the location of an item in a linked list.

Select one:

a. Probing

b. Searching

c. Transferring

 

ANSWER:     B

48. List of nodes that belong to the same parent is called

Select one:

a. Internal Nodes

b. Leave Nodes

c. Cousins

d. Siblings

 

ANSWER:     D

49. The application of Linked List

Select one:

a. Add two characters

b. Add two very small numbers

c. Add two large numbers

d. Add two Strings

 

ANSWER:     C

50. Specify the method for deleting an element from the queue.

Select one:

a. Dequeue

b. Enqueue

c. Deque

 

ANSWER:     A

51. ..........is used to store the unused memory cells.

Select one:

a. Garbage memory

b. Free-storage list

c. Contiguous memory

 

ANSWER:     B

52. ........is used in dividing the larger problems to sub problems.

Select one:

a. Merging

b. Searching

c. Efficiency

d. Modularity

 

ANSWER:     D

53. In a priority queue, insertion and deletion takes place at?

Select one:

a. only at the front

b. front, rear end

c. any position

d. only at rear

 

ANSWER:     C

54. ...........is a linear collection of nodes.

Select one:

a. Linked list

b. Stack

c. Heap

 

ANSWER:     A

55. Which of the following data structure can’t store the non-homogeneous data elements?

Select one:

a. Array

b. Pointers

c. Stacks

d. Records

 

ANSWER:     A

56. Before every insertion into the stack .......... condition need to be checked.

Select one:

a. UNDERFLOW

b. PREFLOW

c. OVERFLOW

 

ANSWER:     C

57. Which of the following is/are the levels of implementation of data structure?

Select one:

a. Abstract level

b. Application level

c. All of the above

d. Implementation level

 

ANSWER:     C

58. Insertion and deletion of element in queue are done in.........and ........ ends respectively.

Select one:

a. Front and Rear

b. Rear and Front

c. Last and First

 

ANSWER:     B

59. ............is very useful in situations when data is to be stored and then retrieved in the reverse order.

Select one:

a. List

b. Stack

c. Linked list

d. Queue

 

ANSWER:     B

60. The data structure which contains the hierarchical relationship between various elements is called a.

Select one:

a. Graph

b. Array

c. Tree

d. Queue

 

ANSWER:     C

61. ..............and............are types of linked list.

Select one:

a. Priority and Circular linked list

b. Ordinary and Singly linked list

c. Doubly and Circular linked list

                ANSWER:     C


QUIZ TWO (2)


1. The post order traversal of binary tree is DEBFCA. Find out the pre order traversal. Select one:

a. ADBFEC

b. ABFCDE

c. ABDECF

d. ABDCEF

 

ANSWER:     A

2. Tree is a non-linear data structure state. Select one:

a. True

b. False

 

ANSWER:     A

3. The head node can be deleted from Doubly Linked List. Select one:

a. True

b. False

 

ANSWER:     B

4. is used in dividing the larger problems to sub problems. Select one:

a. Searching

b. Efficiency

c. Merging

d. Modularity

 

ANSWER:     D

5. …...........and................ are the two fields of linked list.   Select one:

a. Data and Joint Field

b. Graph field

c. Data and Link fields

 

ANSWER:     C

6. .........is a pile in which items are added at one end and removed from the other Select one:

a. Stack

b. List

c. None of the above

d. Queue

 

ANSWER:     D

 

7. In a full binary tree if number of internal nodes is I, then number of leaves L are? Select one:

a. L = I + 1

b. L=1-1

c. L = 2*1

d. L = 2*1-1

 

ANSWER:     A

8. The application of Linked List Select one:

a. Add two large numbers

b. Add two characters

c. Add two very small numbers

d. Add two Strings

 

ANSWER:     A

9. Which of the following is a non-linear data structure? Select one:

a. Trees

b. Stacks

c. String

d. Array

 

ANSWER:     A

10. In 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 Select one:

a. Leaf

b. Path

c. Branch

 

ANSWER:     B

11. In circular linked list, insertion of node requires modification of? Select one:

a. Two pointer

b. Three pointer

c. One pointer

d. None

 

ANSWER:     B

12. In doubly linked lists, traversal can be performed? Select one:

a. In both directions

b. None

c. Only in forward direction

d. Only in reverse direction

 

ANSWER:     A

13. The in order traversal of tree will yield a sorted listing of elements of tree in ..... Select one:

a. Binary search trees

b. Merging

c. AVL Trees

d. Binary trees

 

ANSWER:     A

14.  Which of the following is an application of stack? Select one:

a. infix to postfix

b. tower of Hanoi

c. finding factorial

d. all of the above

 

ANSWER:     D

15. Which of the following is incorrect with respect to binary trees?

Select one:

a. Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1))

b. Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))

c. Let T be a binary tree. For every k > 0, there are no more than 2k nodes in level k

d. Let T be a binary tree with A levels.

( )

 

ANSWER:     B

16. In a head tree..... Select one:

a. values in a node is greater than every value in children of it.

b. terms.

c. conditions.

d. values in a node is greater than every value  in left sub tree and smaller than right sub tree.

 

ANSWER:     D

17. Finding the location of a given item in a collection of items is called ...... Select one:

a. Searching

b. Mining

c. Discovering

d. Finding

 

ANSWER:     A

18. Which of the following data structure is required to convert arithmetic expression in infix to its equivalent postfix notation? Select one:

a. None of above

b. Binary search tree

c. Queue

 

ANSWER:     C

19. Consider an implementation of unsorted doubly linked list. Suppose it has its representation with a head pointer and tail pointer. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list, ii) Insertion at the end of the linked list, iii) Deletion of the front node of the linked list, iv) Deletion of the end node of the linked list. Select one:

a. I,II,III and IV

b. I and II

c. I,II and III

d. I and III

 

ANSWER:     A

20. Which of the following operations is performed more efficiently by doubly linked list than by singly linked list? Select one:

a. Inverting a node after the node with given location

b. traversing a list to process each node

c. Deleting a node whose location in given

d. Searching of an unsorted list for a given item

 

ANSWER:     C

21. Before every insertion into the stack ......... condition need to be checked.

Select one:

a. OVERFLOW

b. PREFLOW

c. UNDERFLOW

 

ANSWER:     A

22. Which of the following operations is performed more efficiently by doubly linked list than by singly linked list? Select one:

 a. Inverting a node after the node with given location

b. Deleting a node whose location in given

c. traversing a list to process each node

d. Searching of an unsorted list for a given item

 

         ANSWER:     B

23. In a priority queue, insertion and deletion takes place at? Select one:

a. only at the front

b. only at rear

c. front, rear end

d. any position

 

ANSWER:     D

24. ..........is used in combining the records in two different files into a single file. Select one:

a. Prunning

b. Concatenating

c. Traversing

d. Merging

 

ANSWER:     D

25. The operation of processing each element in the list is known as...... Select one:

a. inserting

b. sorting

c. merging

d. traversal

 

ANSWER:     D

26. ............. is a linear collection of nodes. Select one:

a. Linked list

b. Stack

c. Heap

 

ANSWER:     A

27.  ..........and...........are the two pointers that are used in queue. Select one:

a. FRONT and REAR

b. FRONT and TOP

c. TOP and REAR

 

ANSWER:     A

28. Consider an implementation of unsorted doubly linked list. Suppose it has its representation with a head pointer only. Given the representation, which of the following operation can be implemented in O(1) time? i) Insertion at the front of the linked list, ii) Insertion at the end of the linked list, iii) Deletion of the front node of the linked list, iv) Deletion of the end node of the linked list. Select one:

a. I,II,III and IV

b. I and II

c. I and III

d. I,II and III

 

ANSWER:     A

29. What is a full binary tree? Select one:

a. Each node has exactly two children

b. Each node has exactly one or two children

c. All the leaves are at the same level

d. Each node has exactly zero or two children

 

ANSWER:     D

30. What is the average case time complexity for finding the height of the binary tree? Select one:

a. h = O(nlogn)

b. h = O(n)

c. h = O(loglogn)

d. h = O(log n)

 

ANSWER:     D

31. A variation of linked list is circular linked list, in which the last node in the list points to first node of the list. One problem with this type of list is? Select one:

a. All of above

b. It waste memory space since the pointer head already points to the first node and thus the list node does not need to point to the first node.

c. It is difficult to traverse the list as the pointer of the last node is now not NULL

d. It is not possible to add a node at the end of the list.

 

ANSWER:     C

32. Addition is having higher precedence than Multiplication state.

Select one:

a. False.

b. True

 

ANSWER:     A

33. Which of the following is not the part of ADT description?

Select one:

a. Both A & B

b. Data

c. None of the above

d. Operations

 

ANSWER:     C

34. New node can be availed from ………………….. list while inserting new element into the queue.

Select one:

a. AVAIL

b. GARBAGE

c. FREE

 

ANSWER:     A



The remaining Quizzes will be add up soon .........







Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.