Quiznetik

Data Structure (DS) | Set 1

1. Which if the following is/are the levels of implementation of data structure

Correct : D. all of the above

2. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……

Correct : A. avl tree

3. Stack is also called as

Correct : A. last in first out

4. …………… is not the component of data structure.

Correct : D. none of above

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

Correct : D. none of the above

6. ……………. Is a pile in which items are added at one end and removed from the other.

Correct : B. queue

7. ………… is very useful in situation when data have to stored and then retrieved in reverse order.

Correct : A. stack

8. Which data structure allows deleting data elements from and inserting at rear?

Correct : B. queues

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

Correct : A. arrays

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

Correct : A. queue linked list

11. Which of the following is non-liner data structure?

Correct : D. trees

12. Herder node is used as sentinel in …..

Correct : C. binary tree

13. Which data structure is used in breadth first search of a graph to hold nodes?

Correct : B. queue

14. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.

Correct : A. input restricted dequeue

15. Which of the following data structure is non linear type?

Correct : D. graph

16. Which of the following data structure is linear type?

Correct : D. stack

17. To represent hierarchical relationship between elements, Which data structure is suitable?

Correct : C. tree

18. A directed graph is ………………. if there is a path from each vertex to every other vertex in the digraph.

Correct : B. strongly connected

19. In the …………….. traversal we process all of a vertex’s descendants before we move to an adjacent vertex.

Correct : A. depth first

20. The number of comparisons done by sequential search is ………………

Correct : B. (n+1)/2

21. In ……………, search start at the beginning of the list and check every element in the list.

Correct : A. linear search

22. Which of the following is not the internal sort?

Correct : C. merge sort

23. A graph is said to be ……………… if the vertices can be split into two sets V1 and V2 such there are no edges between two vertices of V1 or two vertices of V2.

Correct : B. bipartite

24. In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.

Correct : B. 0 and -1

25. In a circular queue the value of r will be ..

Correct : C. r=(r+1)% queue_size

26. The advantage of …………….. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists.

Correct : B. linked lists

27. What will be the value of top, if there is a size of stack STACK_SIZE is 5

Correct : C. 4

28. ………… is not the operation that can be performed on queue.

Correct : D. traversal

29. There is an extra element at the head of the list called a ……….

Correct : B. sentinel

30. A graph is a collection of nodes, called ………. And line segments called arcs or ……….. that connect pair of nodes.

Correct : A. vertices, edges

31. A ……….. is a graph that has weights of costs associated with its edges.

Correct : C. both a and b

32. In general, the binary search method needs no more than ……………. comparisons.

Correct : D. [log2n]+1

33. Which of the following is not the type of queue?

Correct : B. single ended queue

34. The property of binary tree is

Correct : D. the right subtree can be empty

35. Any node is the path from the root to the node is called

Correct : B. ancestor node

36. Which is/are the application(s) of stack

Correct : D. all of the above

37. A …………… is an acyclic digraph, which has only one node with indegree 0, and other nodes have in-degree 1.

Correct : A. directed tree

38. …………………. Is a directed tree in which outdegree of each node is less than or equal to two.

Correct : B. binary tree

39. Which of the following data structure is non-linear type?

Correct : D. tree

40. Which of the following data structure is linear type?

Correct : A. array

41. The logical or mathematical model of a particular organization of data is called a ………

Correct : A. data structure

42. The simplest type of data structure is ………………

Correct : B. linear array

43. Linear arrays are also called ……………….

Correct : B. one-dimensional array

44. Arrays are best data structures …………

Correct : A. for relatively permanent collections of data

45. Which of the following data structures are indexed structures?

Correct : A. linear arrays

46. Each node in a linked list has two pairs of ………….. and ……………….

Correct : A. link field and information field

47. A …………………… does not keep track of address of every element in the list.

Correct : C. linear array

48. When does top value of the stack changes?

Correct : D. after deletion

49. Arrays are best data structures …………

Correct : A. for relatively permanent collections of data.

50. Arrays are best data structures

Correct : A. for relatively permanent collections of data

51. The disadvantage in using a circular linked list is …………………….

Correct : A. it is possible to get into infinite loop.

52. A linear list in which each node has pointers to point to the predecessor and successors nodes is called as ..

Correct : C. doubly linked list

53. A ……………….. is a linear list in which insertions and deletions are made to from either end of the structure.

Correct : D. dequeue

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

Correct : D. any position

55. The time complexity of quick sort is …………..

Correct : C. o(n log n)

56. Which of the following is an application of stack?

Correct : B. tower of hanoi

57. The data structure which is one ended is ………………

Correct : B. stack

58. A list which displays the relationship of adjacency between elements is said to be

Correct : A. linear

59. ……………….. level is where the model becomes compatible executable code

Correct : C. implementation level

60. Which of the following data structure is not linear data structure?

Correct : D. none of the above

61. Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.

Correct : A. push, pop

62. Each array declaration need not give, implicitly or explicitly, the information about

Correct : C. the first data from the set to be stored

63. The elements of an array are stored successively in memory cells because

Correct : A. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

64. Linked lists are best suited

Correct : B. for the size of the structure and the data in the structure are constantly changing

65. Finding the location of the element with a given value is:

Correct : B. search

66. The operation of processing each element in the list is known as

Correct : D. traversal

67. Arrays are best data structures

Correct : A. for relatively permanent collections of data

68. Which of the following statement is true?i) Using singly linked lists and circular list, it is not possible to traverse the list backwards.ii) To find the predecessor, it is required to traverse the list from the first node in case of singly linked list.

Correct : C. both i and ii

69. What will be the value of top, if there is a size of stack STACK_SIZE is 5

Correct : C. 4

70. ………… is not the operation that can be performed on queue.

Correct : D. traversal

71. A data structure where elements can be added or removed at either end but not in the middle is called …

Correct : D. dequeue

72. Which of the following name does not relate to stacks?

Correct : A. fifo lists

73. The term "push" and "pop" is related to the

Correct : C. stacks

74. Which data structure allows deleting data elements from front and inserting at rear?

Correct : B. queue

75. node.next -> node.next.next; will make

Correct : A. node.next inaccessible

76. A circular linked list can be used for

Correct : C. both stack & queue

77. In doubly linked lists

Correct : B. two pointers are maintained to store next and previous nodes.

78. The disadvantage in using a circular linked list is …………………….

Correct : A. it is possible to get into infinite loop

79. A linear list in which each node has pointers to point to the predecessor and successors nodes is called as

Correct : C. doubly linked list

80. The situation when in a linked list START=NULL is

Correct : A. underflow

81. In doubly linked lists, traversal can be performed?

Correct : C. in both directions

82. What differentiates a circular linked list from a normal linked list?

Correct : C. you may or may not have the ‘next’ pointer point to null in a circular linked list

83. How do you count the number of elements in the circular linked list?

Correct : A. public int length(node head) { int length = 0; if( head == null) return 0; node temp = head.getnext(); while(temp != head) { temp = temp.getnext(); length++; } return length; }

84. public int function() { if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; while(temp.getNext() != head) temp = temp.getNext(); if(temp == head) { var = head.getItem(); head = null; return var; } temp.setNext(head.getNext()); var = head.getItem(); head = head.getNext(); return var; } What is the functionality of the following code? Choose the most appropriate answer.

Correct : D. returns the data and deletes the node from the beginning of the list

85. What is the functionality of the following code? Choose the most appropriate answer. public int function() { if(head == null) return Integer.MIN_VALUE; int var; Node temp = head; Node cur; while(temp.getNext() != head) { cur = temp; temp = temp.getNext(); } if(temp == head) { var = head.getItem(); head = null; return var; } var = temp.getItem(); cur.setNext(head); return var; }

Correct : B. returns the data and deletes the node at the end of the list

86. How do you insert a node at the beginning of the list?

Correct : A. public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node); head.setnext(node); size++; }

87. What is a dequeue?

Correct : A. a queue with insert/delete defined for both front and rear ends of the queue

88. Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

Correct : A. full: (rear+1) mod n == front, empty: rear == front

89. Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with respect to this modified stack?

Correct : C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.

90. Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are: i. isEmpty (Q) — returns true if the queue is empty, false otherwise. ii. delete (Q) — deletes the element at the front of the queue and returns its value. iii. insert (Q, i) — inserts the integer i at the rear of the queue. Consider the following function: void f (queue Q) { int i ; if (!isEmpty(Q)) { i = delete(Q); f(Q); insert(Q, i); } }What operation is performed by the above function f ?

Correct : B. reverses the order of the elements in the queue q

91. Consider the following statements:i. First-in-first out types of computations are efficiently supported by STACKS. ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on an array for almost all the basic LIST operations. iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES on a linear array with two indices. iv. Last-in-first-out type of computations are efficiently supported by QUEUES.Which of the following is correct?

Correct : A. (ii) and (iii) are true

92. Which of the following option is not correct?

Correct : C. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault algorithm.

93. Consider a standard Circular Queue 'q' implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are q[0], q[1], q[2].....,q[10]. The front and rear pointers are initialized to point at q[2] . In which position will the ninth element be added?

Correct : A. q[0]

94. Overflow condition in linked list may occur when attempting to .............

Correct : A. create a node when free space pool is empty

95. Which of the following is not a type of Linked List ?

Correct : D. hybrid linked list

96. Linked list is generally considered as an example of _________ type of memory allocation.

Correct : B. dynamic

97. Each Node contain minimum two fields one field called data field to store data. Another field is of type _________.

Correct : D. pointer to node

98. If in a linked list address of first node is 1020 then what will be the address of node at 5th position ?

Correct : D. none of these

99. In Circular Linked List insertion of a node involves the modification of ____ links.

Correct : D. 2

100. If a list contains no elements it is said to be

Correct : B. empty