0% found this document useful (0 votes)
17 views139 pages

550+ DataStructure CCEE MCQ

The document provides a list of various software projects developed using Spring Boot, React JS, and MySQL, along with YouTube links for each project. It also includes a series of questions and answers related to linear data structures, specifically focusing on arrays, linked lists, stacks, and queues, covering initialization, advantages, disadvantages, and operations. Additionally, it discusses time complexity and applications of these data structures.

Uploaded by

d.ankiit25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views139 pages

550+ DataStructure CCEE MCQ

The document provides a list of various software projects developed using Spring Boot, React JS, and MySQL, along with YouTube links for each project. It also includes a series of questions and answers related to linear data structures, specifically focusing on arrays, linked lists, stacks, and queues, covering initialization, advantages, disadvantages, and operations. Additionally, it discusses time complexity and applications of these data structures.

Uploaded by

d.ankiit25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 139

Explore More

Subcription : Premium CDAC NOTES & MATERIAL @99

Contact to Join Click to Join


Premium Group Telegram Group

For More E-Notes


Join Our Community to stay Updated

TAP ON THE ICONS TO JOIN!


Project List

pg. 1 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 2 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

pg. 3 contact us on 8007592194 / 9284926333 www.codewitharrays.in


Project List

Spring Boot + React JS + MySQL Project List


Sr.No Project Name YouTube Link
1 Online E-Learning Hub Platform Project https://youtu.be/KMjyBaWmgzg?si=YckHuNzs7eC84-IW
2 PG Mate / Room sharing/Flat sharing https://youtu.be/4P9cIHg3wvk?si=4uEsi0962CG6Xodp
3 Tour and Travel System Project Version 1.0 https://youtu.be/-UHOBywHaP8?si=KHHfE_A0uv725f12
4 Marriage Hall Booking https://youtu.be/VXz0kZQi5to?si=llOS-QG3TpAFP5k7
5 Ecommerce Shopping project https://youtu.be/vJ_C6LkhrZ0?si=YhcBylSErvdn7paq
6 Bike Rental System Project https://youtu.be/FIzsAmIBCbk?si=7ujQTJqEgkQ8ju2H
7 Multi-Restaurant management system https://youtu.be/pvV-pM2Jf3s?si=PgvnT-yFc8ktrDxB
8 Hospital management system Project https://youtu.be/IynIouBZvY4?si=CXzQs3BsRkjKhZCw
9 Municipal Corporation system Project https://youtu.be/cVMx9NVyI4I?si=qX0oQt-GT-LR_5jF
10 Tour and Travel System Project version 2.0 https://youtu.be/_4u0mB9mHXE?si=gDiAhKBowi2gNUKZ

Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
Chapter: Linear Data Structures - List

1. Which of these best describes an array?

A. A data structure that shows a hierarchical behaviour

B. Container of objects of similar types

C. Arrays are immutable once initialised

D. Array is not a data structure

Answer» B. Container of objects of similar types


discuss

2. How do you initialize an array in C?

A. int arr[3] = (1,2,3);

B. int arr(3) = {1,2,3};

C. int arr[3] = {1,2,3};

D. int arr(3) = (1,2,3);

Answer» C. int arr[3] = {1,2,3};


discuss

3. How do you instantiate an array in Java?

A. int arr[] = new int(3);

B. int arr[];

C. int arr[] = new int[3];

D. int arr() = new int(3);

Answer» C. int arr[] = new int[3];


discuss

4. Which of the following is a correct way to declare a multidimensional array in Java?

A. int[] arr;

B. int arr[[]];

C. int[][]arr;

D. int[[]] arr;

Answer» C. int[][]arr;
discuss

5. When does the ArrayIndexOutOfBoundsException occur?

A. Compile-time

Answer» B. Run-time
5. When does the ArrayIndexOutOfBoundsException occur?

B. Run-time

C. Not an error

D. Not an exception at all

Answer» B. Run-time
discuss

6. Which of the following concepts make extensive use of arrays?

A. Binary trees

B. Scheduling of processes

C. Caching

D. Spatial locality

Answer» D. Spatial locality


discuss (1)

7. What are the advantages of arrays?

A. Objects of mixed data types can be stored

B. Elements in an array cannot be sorted

C. Index of first element of an array is 1

D. Easier to store elements of same data type

Answer» D. Easier to store elements of same data type


discuss

8. What are the disadvantages of arrays?

A. Data structure like queue or stack cannot be implemented

B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

C. Index value of an array can be negative

D. Elements are sequentially accessed

Answer» B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
discuss

9. Assuming int is of 4bytes, what is the size of int arr[15];?

A. 15

B. 19

C. 11

D. 60

Answer» D. 60
discuss

10. In general, the index of the first element in an array is

A. 0

B. -1

C. 2

D. 1

Answer» A. 0
discuss

11. Elements in an array are accessed

A. randomly

B. sequentially

C. exponentially

D. logarithmically

Answer» A. randomly
discuss

12. Which of the following is not a disadvantage to the usage of array?

A. Fixed size

B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

C. Insertion based on position

D. Accessing elements at specified positions

Answer» D. Accessing elements at specified positions


discuss

13. What is the time complexity of inserting at the end in dynamic arrays?

A. O(1)

B. O(n)

C. O(logn)

D. Either O(1) or O(n)

Answer» D. Either O(1) or O(n)


discuss

14. Which of these is not an application of linked list?

A. To implement file systems

Answer» D. Random Access of elements


14. Which of these is not an application of linked list?

B. For separate chaining in hash-tables

C. To implement non-binary trees

D. Random Access of elements

Answer» D. Random Access of elements


discuss

15. Which of the following is false about a doubly linked list?

A. We can navigate in both the directions

B. It requires more space than a singly linked list

C. The insertion and deletion of a node take a bit longer

D. Implementing a doubly linked list is easier than singly linked list

Answer» D. Implementing a doubly linked list is easier than singly linked list
discuss

16. What is the worst case time complexity of inserting a node in a doubly linked list?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(1)

Answer» C. O(n)
discuss

17. Which of the following application makes use of a circular linked list?

A. Undo operation in a text editor

B. Recursive function calls

C. Allocating CPU to resources

Answer» C. Allocating CPU to resources


17. Which of the following application makes use of a circular linked list?

D. Implement Hash Tables

Answer» C. Allocating CPU to resources


discuss

18. Which of the following is false about a circular linked list?

A. Every node has a successor

B. Time complexity of inserting a new node at the head of the list is O(1)

C. Time complexity for deleting the last node is O(n)

D. We can traverse the whole circular linked list by starting from any point

Answer» B. Time complexity of inserting a new node at the head of the list is O(1)
discuss

19. 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. Unordered list

Answer» A. Linked list


discuss

20. In linked list each node contain minimum of two fields. One field is data field to store the data second field
is?

A. Pointer to character

B. Pointer to integer

C. Pointer to node

D. Node

Answer» C. Pointer to node


discuss
21. What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer
is initially pointing to the head of the list?

A. O(1)

B. O(n)

C. θ(n)

D. θ(1)

Answer» C. θ(n)
discuss

22. The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can
be used?

A. Singly linked list

B. Doubly linked list

C. Circular doubly linked list

D. Array implementation of list

Answer» C. Circular doubly linked list


discuss

23. Which of the following c code is used to create new node?

A. ptr = (NODE*)malloc(sizeof(NODE));

B. ptr = (NODE*)malloc(NODE);

C. ptr = (NODE*)malloc(sizeof(NODE*));

D. ptr = (NODE)malloc(sizeof(NODE));

Answer» A. ptr = (NODE*)malloc(sizeof(NODE));


discuss

Chapter: Linear Data Structures -Stacks and Queues

24. Process of inserting an element in stack is called

A. Create

B. Push

C. Evaluation

D. Pop

Answer» B. Push
discuss
25. Process of removing an element from stack is called

A. Create

B. Push

C. Evaluation

D. Pop

Answer» D. Pop
discuss

26. In a stack, if a user tries to remove an element from empty stack it is called

A. Underflow

B. Empty collection

C. Overflow

D. Garbage Collection

Answer» A. Underflow
discuss

27. Pushing an element into stack already having five elements and stack size of 5, then stack becomes

A. Overflow

B. Crash

C. Underflow

D. User flow

Answer» A. Overflow
discuss

28. Entries in a stack are “ordered”. What is the meaning of this statement?

A. A collection of stacks is sortable

B. Stack entries may be compared with the ‘<‘ operation

Answer» D. There is a Sequential entry that is one by one


28. Entries in a stack are “ordered”. What is the meaning of this statement?

C. The entries are stored in a linked list

D. There is a Sequential entry that is one by one

Answer» D. There is a Sequential entry that is one by one


discuss

29. Which of the following is not the application of stack?

A. A parentheses balancing program

B. Tracking of local variables at run time

C. Compiler Syntax Analyzer

D. Data Transfer between two asynchronous process

Answer» D. Data Transfer between two asynchronous process


discuss

30. Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that
you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some
order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the
computation?

A. 1

B. 2

C. none

D. none

Answer» B. 2
discuss

31. What is the value of the postfix expression 6 3 2 4 + – *?

A. 1

B. 40

C. 74

D. -18

Answer» D. -18
discuss

32. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

A. AB+ CD*E – FG /**

B. AB + CD* E – F **G /

C. AB + CD* E – *F *G /

Answer» C. AB + CD* E – *F *G /
32. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?

D. AB + CDE * – * F *G /

Answer» C. AB + CD* E – *F *G /
discuss

33. The data structure required to check whether an expression contains balanced parenthesis is?

A. Stack

B. Queue

C. Array

D. Tree

Answer» A. Stack
discuss

34. What data structure would you mostly likely see in a non recursive implementation of a recursive
algorithm?

A. Linked List

B. Stack

C. Queue

D. Tree

Answer» B. Stack
discuss

35. The process of accessing data stored in a serial access memory is similar to manipulating data on a

A. Heap

B. Binary Tree

C. Array

D. Stack

Answer» D. Stack
discuss
36. The postfix form of A*B+C/D is?

A. *AB/CD+

B. AB*CD/+

C. A*BC+/D

D. ABCD+/*

Answer» B. AB*CD/+
discuss

37. Which data structure is needed to convert infix notation to postfix notation?

A. Branch

B. Tree

C. Queue

D. Stack

Answer» D. Stack
discuss

38. The prefix form of A-B/ (C * D ^ E) is?

A. -/*^ACBDE

B. -ABCD*^DE

C. -A/B*C^DE

D. -A/BC*^DE

Answer» C. -A/B*C^DE
discuss

39. What is the result of the following operation? Top (Push (S, X))

A. X

B. X+S

Answer» A. X
39. What is the result of the following operation? Top (Push (S, X))

C. S

D. none

Answer» A. X
discuss

40. The prefix form of an infix expression (p + q) – (r * t) is?

A. + pq – *rt

B. – +pqr * t

C. – +pq * rt

D. – + * pqrt

Answer» C. – +pq * rt
discuss

41. Which data structure is used for implementing recursion?

A. Queue

B. Stack

C. Array

D. List

Answer» B. Stack
discuss

42. When an operand is read, which of the following is done?

A. It is placed on to the output

B. It is placed in operator stack

C. It is ignored

D. Operator stack is emptied

Answer» A. It is placed on to the output


discuss
43. What should be done when a left parenthesis ‘(‘ is encountered?

A. It is ignored

B. It is placed in the output

C. It is placed in the operator stack

D. The contents of the operator stack is emptied

Answer» C. It is placed in the operator stack


discuss

44. Which of the following is an infix expression?

A. (a+b)*(c+d)

B. ab+c*

C. +ab

D. abc+*

Answer» A. (a+b)*(c+d)
discuss

45. What is the time complexity of an infix to postfix conversion algorithm?

A. O(N log N)

B. O(N)

C. O(N2)

D. O(M log N)

Answer» B. O(N)
discuss

46. Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?

A. operand is always placed in the output

B. operator is placed in the stack when the stack operator has lower precedence

Answer» C. parenthesis are included in the output


46. Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?

C. parenthesis are included in the output

D. higher and equal priority operators follow the same condition

Answer» C. parenthesis are included in the output


discuss

47. In infix to postfix conversion algorithm, the operators are associated from?

A. right to left

B. left to right

C. centre to left

D. centre to right

Answer» B. left to right


discuss

48. A linear list of elements in which deletion can be done from one end (front) and insertion can take place
only at the other end (rear) is known as a ?

A. Queue

B. Stack

C. Tree

D. Linked list

Answer» A. Queue
discuss

49. The data structure required for Breadth First Traversal on a graph is?

A. Stack

B. Array

C. Queue

D. Tree

Answer» C. Queue
discuss

50. A queue follows

A. FIFO (First In First Out) principle

B. LIFO (Last In First Out) principle

C. Ordered array

D. Linear tree

Answer» A. FIFO (First In First Out) principle


discuss
Chapter: Linear Data Structures -Stacks and Queues

51. Circular Queue is also known as

A. Ring Buffer

B. Square Buffer

C. Rectangle Buffer

D. Curve Buffer

Answer» A. Ring Buffer


discuss

52. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will
they be removed?

A. ABCD

B. DCBA

C. DCAB

D. ABDC

Answer» A. ABCD
discuss

53. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle
is?

A. Queue

B. Circular queue

C. Dequeue

D. Priority queue

Answer» C. Dequeue
discuss

54. A normal queue, if implemented using an array of size MAX_SIZE, gets full when

A. Rear = MAX_SIZE – 1

B. Front = (rear + 1)mod MAX_SIZE

C. Front = rear + 1

D. Rear = front

Answer» A. Rear = MAX_SIZE – 1


discuss
55. Queues serve major role in

A. Simulation of recursion

B. Simulation of arbitrary linked list

C. Simulation of limited resource allocation

D. Simulation of heap sort

Answer» C. Simulation of limited resource allocation


discuss

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

A. Ordinary queue

B. Single ended queue

C. Circular queue

D. Priority queue

Answer» B. Single ended queue


discuss

57. With what data structure can a priority queue be implemented?

A. Array

B. List

C. Heap

D. Tree

Answer» D. Tree
discuss

58. Which of the following is not an application of priority queue?

A. Huffman codes

B. Interrupt handling in operating system

C. Undo operation in text editors

D. Bayesian spam filter

Answer» C. Undo operation in text editors


discuss

59. What is the time complexity to insert a node based on key in a priority queue?

A. O(nlogn)

B. O(logn)

Answer» C. O(n)
59. What is the time complexity to insert a node based on key in a priority queue?

C. O(n)

D. O(n2)

Answer» C. O(n)
discuss

60. What is not a disadvantage of priority scheduling in operating systems?

A. A low priority process might have to wait indefinitely for the CPU

B. If the system crashes, the low priority systems may be lost permanently

C. Interrupt handling

D. Indefinite blocking

Answer» C. Interrupt handling


discuss

61. Which of the following is not an advantage of priority queue?

A. Easy to implement

B. Processes with different priority can be efficiently handled

C. Applications with differing requirements

D. Easy to delete elements in any case

Answer» D. Easy to delete elements in any case


discuss

62. What is the time complexity to insert a node based on position in a priority queue?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» C. O(n)
discuss

63. What is a dequeue?

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

B. A queue implemented with a doubly linked list

C. A queue implemented with both singly and doubly linked lists

D. A queue with insert/delete defined for front side of the queue

Answer» A. A queue with insert/delete defined for both front and rear ends of the queue
discuss
64. What are the applications of dequeue?

A. A-Steal job scheduling algorithm

B. Can be used as both stack and queue

C. To find the maximum of all sub arrays of size k

D. To avoid collision in hash tables

Answer» D. To avoid collision in hash tables


discuss

65. Which of the following properties is associated with a queue?

A. First In Last Out

B. First In First Out

C. Last In First Out

D. Last In Last Out

Answer» B. First In First Out


discuss

66. In a circular queue, how do you increment the rear end of the queue?

A. rear++

B. (rear+1) % CAPACITY

C. (rear % CAPACITY)+1

D. rear–

Answer» B. (rear+1) % CAPACITY


discuss

67. What is the term for inserting into a full queue known as?

A. overflow

B. underflow

C. null pointer exception

D. program won’t be compiled

Answer» A. overflow
discuss

68. What is the need for a circular queue?

A. effective usage of memory

B. easier computations

Answer» A. effective usage of memory


68. What is the need for a circular queue?

C. to delete elements based on priority

D. implement LIFO principle in queues

Answer» A. effective usage of memory


discuss

69. What is the space complexity of a linear queue having n elements?

A. O(n)

B. O(nlogn)

C. O(logn)

D. O(1)

Answer» A. O(n)
discuss

Chapter: Non Linear Data Structures - Trees

70. What is the maximum number of children that a binary tree node can have?

A. 0

B. 1

C. 2

D. 3

Answer» C. 2
discuss

71. The following given tree is an example for?

A. Binary tree

B. Binary search tree

Answer» A. Binary tree


C. Fibonacci tree

D. none

Answer» A. Binary tree


discuss

72. How many common operations are performed in a binary tree?

A. 1

B. 2

C. 3

D. 4

Answer» C. 3
discuss

73. What is the traversal strategy used in the binary tree?

A. depth-first traversal

B. breadth-first traversal

C. random traversal

D. Priority traversal

Answer» B. breadth-first traversal


discuss

74. How many types of insertion are performed in a binary tree?

A. 1

B. 2

C. 3

D. 4

Answer» B. 2
discuss
75. What operation does the following diagram depict?

A. inserting a leaf node

B. inserting an internal node

C. deleting a node with 0 or 1 child

D. none

Answer» C. deleting a node with 0 or 1 child


discuss

76. How many bits would a succinct binary tree occupy?

A. n+O(n)

B. 2n+O(n)

C. n/2

D. n

Answer» B. 2n+O(n)
discuss

77. The average depth of a binary tree is given as?

A. O(N)

B. O(√N)

C. O(N2)

D. O(log N)

Answer» D. O(log N)
discuss

78. How many orders of traversal are applicable to a binary tree (In General)? 3

A. 1

B. 4

C. 2

Answer» D. 3
78. How many orders of traversal are applicable to a binary tree (In General)? 3

D. 3

Answer» D. 3
discuss

79. If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an
index i?

A. 2i+1

B. 2i+2

C. 2i

D. 4i

Answer» A. 2i+1
discuss

80. Using what formula can a parent node be located in an array?

A. (i+1)/2

B. (i-1)/2

C. i/2

D. 2i/2

Answer» B. (i-1)/2
discuss

81. Which of the following properties are obeyed by all three tree – traversals?

A. Left subtrees are visited before right subtrees

B. Right subtrees are visited before left subtrees

C. Root node is visited before left subtree

D. Root node is visited before right subtree

Answer» A. Left subtrees are visited before right subtrees


discuss

82. For the tree below, write the pre-order traversal.

A. 2, 7, 2, 6, 5, 11, 5, 9, 4

B. 2, 7, 5, 2, 6, 9, 5, 11, 4

C. 2, 5, 11, 6, 7, 4, 9, 5, 2

D. none

Answer» A. 2, 7, 2, 6, 5, 11, 5, 9, 4
discuss
83. For the tree below, write the post-order traversal.

A. 2, 7, 2, 6, 5, 11, 5, 9, 4

B. 2, 7, 5, 2, 6, 9, 5, 11, 4

C. 2, 5, 11, 6, 7, 4, 9, 5, 2

D. none

Answer» C. 2, 5, 11, 6, 7, 4, 9, 5, 2
discuss

84. What is the time complexity of pre-order traversal in the iterative fashion?

A. O(1)

B. O(n)

C. O(logn)

D. O(nlogn)

Answer» B. O(n)
discuss

85. What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n
is the number of nodes)

A. O(1)

B. O(nlogd)

C. O(logd)

D. O(d)

Answer» D. O(d)
discuss

86. To obtain a prefix expression, which of the tree traversals is used?

A. Level-order traversal

B. Pre-order traversal

C. Post-order traversal

D. In-order traversal

Answer» B. Pre-order traversal


discuss

87. Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of
the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is

A. A, C, D, B, E

Answer» B. A, B, C, D, E
87. Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of
the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is

B. A, B, C, D, E

C. A, B, C, E, D

D. D, B, E, A, C

Answer» B. A, B, C, D, E
discuss

88. What is the possible number of binary trees that can be created with 3 nodes, giving the sequence N, M, L
when traversed in post-order.

A. 15

B. 3

C. 5

D. 8

Answer» C. 5
discuss (1)

89. The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be

A. T Q R S O P

B. T O Q R P S

C. T Q O P S R

D. T Q O S P R

Answer» C. T Q O P S R
discuss

90. A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a valid post-
order sequence of the tree provided the pre-order sequence as 35, 13, 7, 8, 26, 70, 40 and 75?

A. 7, 8, 26, 13, 75, 40, 70, 35

B. 26, 13, 7, 8, 70, 75, 40, 35

C. 7, 8, 13, 26, 35, 40, 70, 75

D. 8, 7, 26, 13, 40, 75, 70, 35

Answer» D. 8, 7, 26, 13, 40, 75, 70, 35


discuss

91. Which of the following pair’s traversals on a binary tree can build the tree uniquely?

A. post-order and pre-order

Answer» B. post-order and in-order


91. Which of the following pair’s traversals on a binary tree can build the tree uniquely?

B. post-order and in-order

C. post-order and level order

D. level order and preorder

Answer» B. post-order and in-order


discuss

92. A full binary tree can be generated using

A. post-order and pre-order traversal

B. pre-order traversal

C. post-order traversal

D. in-order traversal

Answer» A. post-order and pre-order traversal


discuss

93. The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is

A. 3

B. 1

C. 2

D. any number

Answer» B. 1
discuss

94. The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of
following is post-order traversal of the tree?

A. L N M O Q P T

B. N M O P O L T

C. L M N O P Q T

D. O P L M N Q T

Answer» A. L N M O Q P T
discuss

95. Find the postorder traversal of the binary tree shown below.

A. P Q R S T U V W X

B. W R S Q P V T U X

C. S W T Q X U V R P

Answer» C. S W T Q X U V R P
95. Find the postorder traversal of the binary tree shown below.

D. none

Answer» C. S W T Q X U V R P
discuss

96. For the tree below, write the in-order traversal.

A. 6, 2, 5, 7, 11, 2, 5, 9, 4

B. 6, 5, 2, 11, 7, 4, 9, 5, 2

C. 2, 7, 2, 6, 5, 11, 5, 9, 4

D. none

Answer» A. 6, 2, 5, 7, 11, 2, 5, 9, 4
discuss

97. For the tree below, write the level-order traversal.

A. 2, 7, 2, 6, 5, 11, 5, 9, 4

B. 2, 7, 5, 2, 11, 9, 6, 5, 4

C. 2, 5, 11, 6, 7, 4, 9, 5, 2

D. none

Answer» B. 2, 7, 5, 2, 11, 9, 6, 5, 4
discuss

98. What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is
the number of nodes)

A. O(1)

B. O(nlogd)

C. O(logd)

D. O(d)

Answer» D. O(d)
discuss

99. What is the time complexity of level order traversal?

A. O(1)

B. O(n)

C. O(logn)

D. O(nlogn)

Answer» B. O(n)
discuss
100. Which of the following graph traversals closely imitates level order traversal of a binary tree?

A. Depth First Search

B. Breadth First Search

C. Depth & Breadth First Search

D. Binary Search

Answer» B. Breadth First Search


discuss
Chapter: Non Linear Data Structures - Trees

101. In a binary search tree, which of the following traversals would print the numbers in the ascending order?

A. Level-order traversal

B. Pre-order traversal

C. Post-order traversal

D. In-order traversal

Answer» D. In-order traversal


discuss

102. The number of edges from the root to the node is called of the tree.

A. Height

B. Depth

C. Length

D. Width

Answer» B. Depth
discuss

103. The number of edges from the node to the deepest leaf is called of the tree.

A. Height

B. Depth

C. Length

D. Width

Answer» A. Height
discuss

104. What is a full binary tree?

A. Each node has exactly zero or two children

B. Each node has exactly two children

C. All the leaves are at the same level

D. Each node has exactly one or two children

Answer» A. Each node has exactly zero or two children


discuss
105. What is a complete binary tree?

A. Each node has exactly zero or two children

B. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left

C. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right

D. A tree In which all nodes have degree 2

Answer» C. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to
right
discuss

106. What is the average case time complexity for finding the height of the binary tree?

A. h = O(loglogn)

B. h = O(nlogn)

C. h = O(n)

D. h = O(log n)

Answer» D. h = O(log n)
discuss

107. Which of the following is not an advantage of trees?

A. Hierarchical structure

B. Faster search

C. Router algorithms

D. Undo/Redo operations in a notepad

Answer» D. Undo/Redo operations in a notepad


discuss

108. In a full binary tree if number of internal nodes is I, then number of leaves L are?

A. L = 2*I

B. L = I + 1

C. L = I – 1

D. L = 2*I – 1

Answer» B. L = I + 1
discuss

109. In a full binary tree if number of internal nodes is I, then number of nodes N are?

A. N = 2*I

B. N = I + 1

Answer» D. N = 2*I + 1
109. In a full binary tree if number of internal nodes is I, then number of nodes N are?

C. N = I – 1

D. N = 2*I + 1

Answer» D. N = 2*I + 1
discuss

110. In a full binary tree if there are L leaves, then total number of nodes N are?

A. N = 2*L

B. N = L + 1

C. N = L – 1

D. N = 2*L – 1

Answer» D. N = 2*L – 1
discuss

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

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

B. Let T be a binary tree with λ levels. Then T has no more than 2λ – 1 nodes

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

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

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

112. Which of the following is false about a binary search tree?

A. The left child is always lesser than its parent

B. The right child is always greater than its parent

C. The left and right sub-trees should also be binary search trees

D. In order sequence gives decreasing order of elements

Answer» D. In order sequence gives decreasing order of elements


discuss

113. What is the speciality about the inorder traversal of a binary search tree?

A. It traverses in a non increasing order

B. It traverses in an increasing order

C. It traverses in a random fashion

D. It traverses based on priority of the node

Answer» B. It traverses in an increasing order


discuss
114. What are the worst case and average case complexities of a binary search tree?

A. O(n), O(n)

B. O(logn), O(logn)

C. O(logn), O(n)

D. O(n), O(logn)

Answer» D. O(n), O(logn)


discuss

115. What are the conditions for an optimal binary search tree and what is its advantage?

A. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost

B. You should know the frequency of access of the keys, improves the lookup time

The tree can be modified and you should know the number of elements in the tree before hand, it improves the deletion
C.
time

D. The tree should be just modified and improves the lookup time

Answer» A. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost
discuss

116. Which of the following is not the self balancing binary search tree?

A. AVL Tree

B. 2-3-4 Tree

C. Red – Black Tree

D. Splay Tree

Answer» B. 2-3-4 Tree


discuss

117. The binary tree sort implemented using a self – balancing binary search tree takes time is worst case.

A. O(n log n)

B. O(n)

C. O(n2)

D. O(log n)

Answer» A. O(n log n)


discuss

118. An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any
node differ by

A. At least one

Answer» B. At most one


118. An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any
node differ by

B. At most one

C. Two

D. At most two

Answer» B. At most one


discuss

119. Associative arrays can be implemented using

A. B-tree

B. A doubly linked list

C. A single linked list

D. A self balancing binary search tree

Answer» D. A self balancing binary search tree


discuss

120. Which of the following is a self – balancing binary search tree?

A. 2-3 tree

B. Threaded binary tree

C. AA tree

D. Treap

Answer» C. AA tree
discuss

121. A self – balancing binary search tree can be used to implement

A. Priority queue

B. Hash table

C. Heap sort

D. Priority queue and Heap sort

Answer» A. Priority queue


discuss

122. In which of the following self – balancing binary search tree the recently accessed element can be accessed
quickly?

A. AVL tree

B. AA tree

Answer» C. Splay tree


122. In which of the following self – balancing binary search tree the recently accessed element can be accessed
quickly?

C. Splay tree

D. Red – Black tree

Answer» C. Splay tree


discuss

123. The minimum height of self balancing binary search tree with n nodes is

A. log2(n)

B. n

C. 2n + 1

D. 2n – 1

Answer» A. log2(n)
discuss

124. What is an AVL tree?

A. a tree which is balanced and is a height balanced tree

B. a tree which is unbalanced and is a height balanced tree

C. a tree with three children

D. a tree with atmost 3 children

Answer» A. a tree which is balanced and is a height balanced tree


discuss

125. Why we need to a binary tree which is height balanced?

A. to avoid formation of skew trees

B. to save memory

C. to attain faster memory access

D. to simplify storing

Answer» A. to avoid formation of skew trees


discuss

126. What is the maximum height of an AVL tree with p nodes?

A. p

B. log(p)

C. log(p)/2

D. P⁄2

Answer» B. log(p)
discuss

127. Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without
performing any rotations?

A. just build the tree with the given input

B. find the median of the set of elements given, make it as root and construct the tree

C. use trial and error

D. use dynamic programming to build the tree

Answer» B. find the median of the set of elements given, make it as root and construct the tree
discuss

128. What maximum difference in heights between the leafs of a AVL tree is possible?

A. log(n) where n is the number of nodes

B. n where n is the number of nodes

C. 0 or 1

D. atmost 1

Answer» A. log(n) where n is the number of nodes


discuss

129. What is missing?

A. Height(w-left), x-height

B. Height(w-right), x-height

C. Height(w-left), x

D. Height(w-left)

Answer» A. Height(w-left), x-height


discuss
130. Why to prefer red-black trees over AVL trees?

A. Because red-black is more rigidly balanced

B. AVL tree store balance factor in every node which costs space

C. AVL tree fails at scale

D. Red black is more efficient

Answer» B. AVL tree store balance factor in every node which costs space
discuss

131. Which of the following is the most widely used external memory data structure?

A. AVL tree

B. B-tree

C. Red-black tree

D. Both AVL tree and Red-black tree

Answer» B. B-tree
discuss

132. B-tree of order n is a order-n multiway tree in which each non-root node contains

A. at most (n – 1)/2 keys

B. exact (n – 1)/2 keys

C. at least 2n keys

D. at least (n – 1)/2 keys

Answer» D. at least (n – 1)/2 keys


discuss

133. A B-tree of order 4 and of height 3 will have a maximum of keys.

A. 255

B. 63

C. 127

D. 188

Answer» A. 255
discuss

134. Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are
written?

A. 14

B. 7

Answer» C. 11
134. Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are
written?

C. 11

D. 5

Answer» C. 11
discuss

135. trees are B-trees of order 4. They are an isometric of trees.

A. AVL

B. AA

C. 2-3

D. Red-Black

Answer» D. Red-Black
discuss

136. What is the best case height of a B-tree of order n and which has k keys?

A. logn (k+1) – 1

B. nk

C. logk (n+1) – 1

D. klogn

Answer» A. logn (k+1) – 1


discuss

137. Which of the following is true?

A. larger the order of B-tree, less frequently the split occurs

B. larger the order of B-tree, more frequently the split occurs

C. smaller the order of B-tree, more frequently the split occurs

D. smaller the order of B-tree, less frequently the split occurs

Answer» A. larger the order of B-tree, less frequently the split occurs
discuss (1)

138. In a max-heap, element with the greatest key is always in the which node?

A. Leaf node

B. First node of left sub tree

C. root node

D. First node of right sub tree

Answer» C. root node


discuss

139. The worst case complexity of deleting any arbitrary node value element from heap is

A. O(logn)

B. O(n)

C. O(nlogn)

D. O(n2)

Answer» A. O(logn)
discuss

140. Heap can be used as

A. Priority queue

B. Stack

C. A decreasing order array

D. Normal Array

Answer» A. Priority queue


discuss

141. If we implement heap as min-heap, deleting root node (value 1)from the heap. What would be the value of
root node after second iteration if leaf node (value 100) is chosen to replace the root at start.

A. 2

B. 100

C. 17

D. none

Answer» A. 2
discuss

142. An array consists of n elements. We want to create a heap using the elements. The time complexity of
building a heap will be in order of

A. O(n*n*logn)

B. O(n*logn)

C. O(n*n)

D. O(n *logn *logn)

Answer» B. O(n*logn)
discuss

Chapter: Non Linear Data Structures - Graphs


143. Which of the following statements for a simple graph is correct?

A. Every path is a trail

B. Every trail is a path

C. Every trail is a path as well as every path is a trail

D. Path and trail have no relation

Answer» A. Every path is a trail


discuss

144. For the given graph(G), which of the following statements is true?

A. G is a complete graph

B. G is not a connected graph

C. The vertex connectivity of the graph is 2

D. none

Answer» C. The vertex connectivity of the graph is 2


discuss

145. What is the number of edges present in a complete graph having n vertices?

A. (n*(n+1))/2

B. (n*(n-1))/2

C. n

D. Information given is insufficient

Answer» B. (n*(n-1))/2
discuss

146. The given Graph is regular.

A. True

B. False

C. none

D. none

Answer» A. True
discuss

147. A connected planar graph having 6 vertices, 7 edges contains regions.

A. 15

B. 3

Answer» B. 3
147. A connected planar graph having 6 vertices, 7 edges contains regions.

C. 1

D. 11

Answer» B. 3
discuss

148. If a simple graph G, contains n vertices and m edges, the number of edges in the Graph G'(Complement of
G) is

A. (n*n-n-2*m)/2

B. (n*n+n+2*m)/2

C. (n*n-n-2*m)/2

D. (n*n-n+2*m)/2

Answer» A. (n*n-n-2*m)/2
discuss

149. Which of the following properties does a simple graph not hold?

A. Must be connected

B. Must be unweighted

C. Must have no loops or multiple edges

D. Must have no multiple edges

Answer» A. Must be connected


discuss

150. What is the maximum number of edges in a bipartite graph having 10 vertices?

A. 24

B. 21

C. 25

D. 16

Answer» C. 25
discuss
Chapter: Non Linear Data Structures - Graphs

151. Which of the following is true?

A. A graph may contain no edges and many vertices

B. A graph may contain many edges and no vertices

C. A graph may contain no edges and no vertices

D. A graph may contain no vertices and many edges

Answer» B. A graph may contain many edges and no vertices


discuss

152. For a given graph G having v vertices and e edges which is connected and has no cycles, which of the
following statements is true?

A. v=e

B. v = e+1

C. v + 1 = e

D. v = e-1

Answer» B. v = e+1
discuss

153. For which of the following combinations of the degrees of vertices would the connected graph be
eulerian?

A. 1,2,3

B. 2,3,4

C. 2,4,5

D. 1,3,5

Answer» A. 1,2,3
discuss

154. A graph with all vertices having equal degree is known as a

A. Multi Graph

B. Regular Graph

C. Simple Graph

D. Complete Graph

Answer» B. Regular Graph


discuss
155. Which of the following ways can be used to represent a graph?

A. Adjacency List and Adjacency Matrix

B. Incidence Matrix

C. Adjacency List, Adjacency Matrix as well as Incidence Matrix

D. No way to represent

Answer» C. Adjacency List, Adjacency Matrix as well as Incidence Matrix


discuss

156. The number of possible undirected graphs which may have self loops but no multiple edges and have n
vertices is

A. 2((n*(n-1))/2)

B. 2((n*(n+1))/2)

C. 2((n-1)*(n-1))/2)

D. 2((n*n)/2)

Answer» D. 2((n*n)/2)
discuss

157. Given a plane graph, G having 2 connected component, having 6 vertices, 7 edges and 4 regions. What will
be the number of connected components?

A. 1

B. 2

C. 3

D. 4

Answer» B. 2
discuss

158. Number of vertices with odd degrees in a graph having a eulerian walk is

A. 0

B. Can’t be predicted

C. 2

D. either 0 or 2

Answer» D. either 0 or 2
discuss

159. How many of the following statements are correct?

A. All cyclic graphs are complete graphs.

Answer» B. All complete graphs are cyclic graphs.


159. How many of the following statements are correct?

B. All complete graphs are cyclic graphs.

C. All paths are bipartite.

D. All cyclic graphs are bipartite.

Answer» B. All complete graphs are cyclic graphs.


discuss

160. What is the number of vertices of degree 2 in a path graph having n vertices,here n>2.

A. n-2

B. n

C. 2

D. 0

Answer» A. n-2
discuss

161. What would the time complexity to check if an undirected graph with V vertices and E edges is Bipartite or
not given its adjacency matrix?

A. O(E*E)

B. O(V*V)

C. O(E)

D. O(V)

Answer» B. O(V*V)
discuss

162. With V(greater than 1) vertices, how many edges at most can a Directed Acyclic Graph possess?

A. (V*(V-1))/2

B. (V*(V+1))/2

C. (V+1)C2

D. (V-1)C2

Answer» A. (V*(V-1))/2
discuss

163. The topological sorting of any DAG can be done in time.

A. cubic

B. quadratic

C. linear

Answer» C. linear
163. The topological sorting of any DAG can be done in time.

D. logarithmic

Answer» C. linear
discuss

164. If there are more than 1 topological sorting of a DAG is possible, which of the following is true.

A. Many Hamiltonian paths are possible

B. No Hamiltonian path is possible

C. Exactly 1 Hamiltonian path is possible

D. Given information is insufficient to comment anything

Answer» B. No Hamiltonian path is possible


discuss

165. Which of the given statement is true?

A. All the Cyclic Directed Graphs have topological sortings

B. All the Acyclic Directed Graphs have topological sortings

C. All Directed Graphs have topological sortings

D. All the cyclic directed graphs have non topological sortings

Answer» D. All the cyclic directed graphs have non topological sortings
discuss

166. What is the value of the sum of the minimum in-degree and maximum out-degree of an Directed Acyclic
Graph?

A. Depends on a Graph

B. Will always be zero

C. Will always be greater than zero

D. May be zero or greater than zero

Answer» B. Will always be zero


discuss

Chapter: Searching, Sorting and Hashing Techniques

167. What is the best case for linear search?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(1)

Answer» D. O(1)
discuss

168. What is the worst case for linear search?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(1)

Answer» C. O(n)
discuss

169. What is the best case and worst case complexity of ordered linear search?

A. O(nlogn), O(logn)

B. O(logn), O(nlogn)

C. O(n), O(1)

D. O(1), O(n)

Answer» D. O(1), O(n)


discuss

170. Which of the following is a disadvantage of linear search?

A. Requires more space

B. Greater time complexities compared to other searching algorithms

C. Not easy to understand

D. Not easy to implement

Answer» B. Greater time complexities compared to other searching algorithms


discuss

171. What is the advantage of recursive approach than an iterative approach?

A. Consumes less memory

B. Less code and easy to implement

C. Consumes more memory

D. More code has to be written

Answer» B. Less code and easy to implement


discuss

172. Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?

A. 5

Answer» C. 3
172. Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?

B. 2

C. 3

D. 4

Answer» C. 3
discuss

173. Given an array arr = {45,77,89,90,94,99,100} and key = 99; what are the mid values(corresponding array
elements) in the first and second levels of recursion?

A. 90 and 99

B. 90 and 94

C. 89 and 99

D. 89 and 94

Answer» A. 90 and 99
discuss

174. What is the worst case complexity of binary search using recursion?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» B. O(logn)
discuss

175. What is the average case time complexity of binary search using recursion?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» B. O(logn)
discuss

176. Which of the following is not an application of binary search?

A. To find the lower/upper bound in an ordered sequence

B. Union of intervals

C. Debugging

Answer» D. To search in unordered list


176. Which of the following is not an application of binary search?

D. To search in unordered list

Answer» D. To search in unordered list


discuss

177. Binary Search can be categorized into which of the following?

A. Brute Force technique

B. Divide and conquer

C. Greedy algorithm

D. Dynamic programming

Answer» B. Divide and conquer


discuss

178. Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found?

A. 1

B. 3

C. 4

D. 2

Answer» D. 2
discuss

179. Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(corresponding array
elements) generated in the first and second iterations?

A. 90 and 99

B. 90 and 100

C. 89 and 94

D. 94 and 99

Answer» A. 90 and 99
discuss

180. What is the time complexity of binary search with iteration?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» B. O(logn)
discuss
181. What is an external sorting algorithm?

A. Algorithm that uses tape or disk during the sort

B. Algorithm that uses main memory during the sort

C. Algorithm that involves swapping

D. Algorithm that are considered ‘in place’

Answer» A. Algorithm that uses tape or disk during the sort


discuss

182. What is an internal sorting algorithm?

A. Algorithm that uses tape or disk during the sort

B. Algorithm that uses main memory during the sort

C. Algorithm that involves swapping

D. Algorithm that are considered ‘in place’

Answer» B. Algorithm that uses main memory during the sort


discuss

183. What is the worst case complexity of bubble sort?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» D. O(n2)
discuss

184. What is the average case complexity of bubble sort?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» D. O(n2)
discuss

185. Which of the following is not an advantage of optimised bubble sort over other sorting techniques in case
of sorted elements?

A. It is faster

B. Consumes less memory

Answer» C. Detects whether the input is already sorted


185. Which of the following is not an advantage of optimised bubble sort over other sorting techniques in case
of sorted elements?

C. Detects whether the input is already sorted

D. Consumes less time

Answer» C. Detects whether the input is already sorted


discuss

186. The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will
be done to sort the array?

A. 4

B. 2

C. 1

D. 0

Answer» A. 4
discuss

187. What is the best case efficiency of bubble sort in the improvised version?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» C. O(n)
discuss

188. The given array is arr = {1,2,4,3}. Bubble sort is used to sort the array elements. How many iterations will
be done to sort the array with improvised version?

A. 4

B. 2

C. 1

D. 0

Answer» B. 2
discuss

189. What is an in-place sorting algorithm?

A. It needs O(1) or O(logn) memory to create auxiliary locations

B. The input is already sorted and in-place

Answer» A. It needs O(1) or O(logn) memory to create auxiliary locations


189. What is an in-place sorting algorithm?

C. It requires additional storage

D. It requires additional space

Answer» A. It needs O(1) or O(logn) memory to create auxiliary locations


discuss

190. In the following scenarios, when will you use selection sort?

A. The input is already sorted

B. A large file has to be sorted

C. Large values need to be sorted with small keys

D. Small values need to be sorted with large keys

Answer» C. Large values need to be sorted with small keys


discuss

191. What is the worst case complexity of selection sort?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» D. O(n2)
discuss

192. What is the advantage of selection sort over other sorting techniques?

A. It requires no additional storage space

B. It is scalable

C. It works best for inputs which are already sorted

D. It is faster than any other sorting technique

Answer» A. It requires no additional storage space


discuss

193. What is the average case complexity of selection sort?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» D. O(n2)
discuss
194. What is the disadvantage of selection sort?

A. It requires auxiliary memory

B. It is not scalable

C. It can be used for small keys8

D. It takes linear time to sort the elements

Answer» B. It is not scalable


discuss

195. The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively
are,

A. 5 and 4

B. 4 and 5

C. 2 and 4

D. 2 and 5

Answer» A. 5 and 4
discuss

196. The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of
iterations in selection sort and bubble sort respectively are,

A. 5 and 4

B. 1 and 4

C. 0 and 4

D. 4 and 1

Answer» D. 4 and 1
discuss

197. What is the best case complexity of selection sort?

A. O(nlogn)

B. O(logn)

C. O(n)

D. O(n2)

Answer» D. O(n2)
discuss

198. Shell sort is also known as

A. diminishing decrement sort

Answer» B. diminishing increment sort


198. Shell sort is also known as

B. diminishing increment sort

C. partition exchange sort

D. diminishing insertion sort

Answer» B. diminishing increment sort


discuss

199. Statement 1: Shell sort is a stable sorting algorithm. Statement 2: Shell sort is an in-place sorting
algorithm.

A. Both statements are true

B. Statement 2 is true but statement 1 is false

C. Statement 2 is false but statement 1 is true

D. none

Answer» B. Statement 2 is true but statement 1 is false


discuss

200. Shell sort is applied on the elements 27 59 49 37 15 90 81 39 and the chosen decreasing sequence of
increments is (5,3,1). The result after the first iteration will be

A. 27 59 49 37 15 90 81 39

B. 27 59 37 49 15 90 81 39

C. 27 59 39 37 15 90 81 49

D. 15 59 49 37 27 90 81 39

Answer» C. 27 59 39 37 15 90 81 49
discuss
Chapter: Searching, Sorting and Hashing Techniques

201. Shell sort is an improvement on

A. insertion sort

B. selection sort

C. binary tree sort

D. quick sort

Answer» A. insertion sort


discuss

202. An array that is first 7-sorted, then 5-sorted becomes

A. 7-ordered

B. 5-ordered

C. both 2-ordered and 5-ordered

D. both 7-ordered and 5-ordered

Answer» D. both 7-ordered and 5-ordered


discuss

203. If Hibbard increments (h1= 1, h2= 3, h3= 7, …, hk = 2k–1) are used in a Shell sortimplementation, then the
best case time complexity will be

A. O(nlogn)

B. O(n)

C. O(n2)

D. O(logn)

Answer» A. O(nlogn)
discuss

204. Records R1, R2, R3,.. RN with keys K1, K2, K3,.. KN are said to be h-ordered, if

A. Ki <= Ki+h for 1<= i*h <= N

B. Kh <= Ki+h for 1<= i <= N

C. Ki <= Kh for 1<= i <= h

D. Ki <= Ki+h for 1<= i <= N-h

Answer» D. Ki <= Ki+h for 1<= i <= N-h


discuss
205. Which of the following is true?

Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not
A.
completely sort the elements

B. Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap like in Comb sort

C. Comb sort’s passes completely sort the elements before going on to the next-smallest gap like in Shell sort

Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap while Comb sort’s passes
D.
completely sort the elements

Answer» A. Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes
do not completely sort the elements
discuss

206. Which of the following is the distribution sort?

A. Heap sort

B. Smooth sort

C. Quick sort

D. LSD radix sort

Answer» D. LSD radix sort


discuss

207. What is the worst case time complexity of LSD radix sort?

A. O(nlogn)

B. O(wn)

C. O(n)

D. O(n + w)

Answer» B. O(wn)
discuss

208. LSD radix sort requires passes to sort N elements.

A. (w/logR)

B. N(w/logR)

C. (w/log(RN))

D. (wN/log(N))

Answer» A. (w/logR)
discuss

209. Which of the following is false?

A. LSD radix sort is an integer sorting algorithm

Answer» B. LSD radix sort is a comparison sorting algorithm


209. Which of the following is false?

B. LSD radix sort is a comparison sorting algorithm

C. LSD radix sort is a distribution sort

D. LSD radix sort uses bucket sort

Answer» B. LSD radix sort is a comparison sorting algorithm


discuss

210. Which of the following sorting algorithm is stable?

A. Heap sort

B. Selection sort

C. In-place MSD radix sort

D. LSD radix sort

Answer» D. LSD radix sort


discuss

211. Which of the following should be used to sort a huge database on a fixed-length key field?

A. Insertion sort

B. Merge sort

C. LSD radix sort

D. Quick sort

Answer» C. LSD radix sort


discuss

212. Which of the following is a combination of LSD and MSD radix sorts?

A. Forward radix sort

B. 3-way radix quick sort

C. Trie base radix sort

D. Flash sort

Answer» A. Forward radix sort


discuss

213. Which of the following is true for the LSD radix sort?

A. works best for variable length strings

B. accesses memory randomly

C. inner loop has less instructions

Answer» B. accesses memory randomly


213. Which of the following is true for the LSD radix sort?

D. sorts the keys in left-to-right order

Answer» B. accesses memory randomly


discuss

214. Which scheme uses a randomization approach?

A. hashing by division

B. hashing by multiplication

C. universal hashing

D. open addressing

Answer» C. universal hashing


discuss

215. Which hash function satisfies the condition of simple uniform hashing?

A. h(k) = lowerbound(km)

B. h(k)= upperbound(mk)

C. h(k)= lowerbound(k)

D. h(k)= upperbound(k)

Answer» A. h(k) = lowerbound(km)


discuss

216. What is the hash function used in the division method?

A. h(k) = k/m

B. h(k) = k mod m

C. h(k) = m/k

D. h(k) = m mod k

Answer» B. h(k) = k mod m


discuss

217. What can be the value of m in the division method?

A. Any prime number

B. Any even number

C. 2p – 1

D. 2p

Answer» A. Any prime number


discuss
218. Which scheme provides good performance?

A. open addressing

B. universal hashing

C. hashing by division

D. hashing by multiplication

Answer» B. universal hashing


discuss

219. Using division method, in a given hash table of size 157, the key of value 172 be placed at position

A. 19

B. 72

C. 15

D. 17

Answer» C. 15
discuss

220. How many steps are involved in creating a hash function using a multiplication method?

A. 1

B. 4

C. 3

D. 2

Answer» D. 2
discuss

221. What is the hash function used in multiplication method?

A. h(k) = floor( m(kA mod 1))

B. h(k) = ceil( m(kA mod 1))

C. h(k) = floor(kA mod m)

D. h(k) = ceil( kA mod m)

Answer» A. h(k) = floor( m(kA mod 1))


discuss

222. What is the advantage of the multiplication method?

A. only 2 steps are involved

B. using constant

Answer» C. value of m not critical


222. What is the advantage of the multiplication method?

C. value of m not critical

D. simple multiplication

Answer» C. value of m not critical


discuss

223. What is the table size when the value of p is 7 in multiplication method of creating hash functions?

A. 14

B. 128

C. 49

D. 127

Answer» B. 128
discuss

224. What is the average retrieval time when n keys hash to the same slot?

A. Theta(n)

B. Theta(n2)

C. Theta(nlog n)

D. Big-Oh(n2)

Answer» A. Theta(n)
discuss

More MCQs

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

A. abstract level

B. application level

C. implementation level

D. all of the above

Answer» D. all of the above


discuss

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

A. avl tree

B. red-black tree

C. lemma tree

D. none of the above

Answer» A. avl tree


discuss

227. Stack is also called as

A. last in first out

B. first in last out

C. last in last out

D. first in first out

Answer» A. last in first out


discuss

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

A. operations

B. storage structures

C. algorithms

D. none of above

Answer» D. none of above


discuss

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

A. data

B. operations

C. both of the above

D. none of the above

Answer» D. none of the above


discuss

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

A. stack

B. queue

C. list

D. none of the above

Answer» B. queue
discuss

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

A. stack

Answer» A. stack
231. ………… is very useful in situation when data have to stored and then retrieved in reverse order.

B. queue

C. list

D. link list

Answer» A. stack
discuss

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

A. stacks

B. queues

C. dequeues

D. binary search tree

Answer» B. queues
discuss

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

A. arrays

B. records

C. pointers

D. stacks

Answer» A. arrays
discuss

234. 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.

A. queue linked list

B. stacks linked list

C. both of them

D. neither of them

Answer» A. queue linked list


discuss

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

A. stacks

B. list

C. strings

Answer» D. trees
235. Which of the following is non-liner data structure?

D. trees

Answer» D. trees
discuss

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

A. graphs

B. stacks

C. binary tree

D. queues

Answer» C. binary tree


discuss

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

A. stack

B. queue

C. tree

D. array

Answer» B. queue
discuss

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

A. input restricted dequeue

B. output restricted qequeue

C. priority queues

D. stack

Answer» A. input restricted dequeue


discuss

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

A. strings

B. lists

C. stacks

D. graph

Answer» D. graph
discuss
240. Which of the following data structure is linear type?

A. graph

B. trees

C. binary tree

D. stack

Answer» D. stack
discuss

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

A. dequeue

B. priority

C. tree

D. graph

Answer» C. tree
discuss (1)

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

A. weakly connected

B. strongly connected

C. tightly connected

D. linearly connected

Answer» B. strongly connected


discuss

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

A. depth first

B. breadth first

C. with first

D. depth limited

Answer» A. depth first


discuss

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

A. (n/2)+1

B. (n+1)/2

Answer» B. (n+1)/2
244. The number of comparisons done by sequential search is ………………

C. (n-1)/2

D. (n+2)/2

Answer» B. (n+1)/2
discuss

245. 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

Answer» A. linear search


discuss

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

A. insertion sort

B. bubble sort

C. merge sort

D. heap sort

Answer» C. merge sort


discuss

247. 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.

A. partite

B. bipartite

C. rooted

D. bisects

Answer» B. bipartite
discuss

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

A. 0 and 1

B. 0 and -1

C. -1 and 0

D. 1 and 0

Answer» B. 0 and -1
discuss

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

A. r=r+1

B. r=(r+1)% [queue_size – 1]

C. r=(r+1)% queue_size

D. r=(r-1)% queue_size

Answer» C. r=(r+1)% queue_size


discuss

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

A. lists

B. linked lists

C. trees

D. queues

Answer» B. linked lists


discuss
More MCQs

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

A. 5

B. 6

C. 4

D. none

Answer» C. 4
discuss

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

A. insertion

B. deletion

C. retrieval

D. traversal

Answer» D. traversal
discuss

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

A. antinel

B. sentinel

C. list header

D. list head

Answer» B. sentinel
discuss

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

A. vertices, edges

B. edges, vertices

C. vertices, paths

D. graph node, edges

Answer» A. vertices, edges


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

A. network

B. weighted graph

C. both a and b

D. none a and b

Answer» C. both a and b


discuss

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

A. [log2n]-1

B. [logn]+1

C. [log2n]

D. [log2n]+1

Answer» D. [log2n]+1
discuss

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

A. ordinary queue

B. single ended queue

C. circular queue

D. priority queue

Answer» B. single ended queue


discuss

258. The property of binary tree is

A. the first subset is called left subtree

B. the second subtree is called right subtree

C. the root cannot contain null

D. the right subtree can be empty

Answer» D. the right subtree can be empty


discuss

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

A. successor node

B. ancestor node

Answer» B. ancestor node


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

C. internal node

D. none of the above

Answer» B. ancestor node


discuss

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

A. function calls

B. large number arithmetic

C. evaluation of arithmetic expressions

D. all of the above

Answer» D. all of the above


discuss

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

A. directed tree

B. undirected tree

C. dis-joint tree

D. direction oriented tree

Answer» A. directed tree


discuss

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

A. unary tree

B. binary tree

C. trinary tree

D. both b and c

Answer» B. binary tree


discuss

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

A. strings

B. lists

C. stacks

D. tree

Answer» D. tree
discuss

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

A. array

B. tree

C. graphs

D. hierarchy

Answer» A. array
discuss

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

A. data structure

B. data arrangement

C. data configuration

D. data formation

Answer» A. data structure


discuss

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

A. multidimensional array

B. linear array

C. two dimensional array

D. three dimensional array

Answer» B. linear array


discuss

267. Linear arrays are also called ……………….

A. straight line array

B. one-dimensional array

C. vertical array

D. horizontal array

Answer» B. one-dimensional array


discuss

268. Arrays are best data structures …………

A. for relatively permanent collections of data

Answer» A. for relatively permanent collections of data


268. Arrays are best data structures …………

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

C. for both of above situation

D. for none of the above

Answer» A. for relatively permanent collections of data


discuss

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

A. linear arrays

B. linked lists

C. graphs

D. trees

Answer» A. linear arrays


discuss

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

A. link field and information field

B. link field and avail field

C. avail field and information field

D. address field and link field

Answer» A. link field and information field


discuss

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

A. stack

B. string

C. linear array

D. queue

Answer» C. linear array


discuss

272. When does top value of the stack changes?

A. before deletion

B. while checking underflow

C. at the time of deletion

Answer» D. after deletion


272. When does top value of the stack changes?

D. after deletion

Answer» D. after deletion


discuss

273. Arrays 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

D. for none of the above

Answer» A. for relatively permanent collections of data.


discuss

274. Arrays 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

D. for none of above situation

Answer» A. for relatively permanent collections of data


discuss

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

A. singly linked list

B. circular linked list

C. doubly linked list

D. linear linked list

Answer» C. doubly linked list


discuss

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

A. circular queue

B. random of queue

C. priority

D. dequeue

Answer» D. dequeue
discuss
277. In a priority queue, insertion and deletion takes place at ………………

A. front, rear end

B. only at rear end

C. only at front end

D. any position

Answer» D. any position


discuss

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

A. o(n)

B. o(n2)

C. o(n log n)

D. o(log n)

Answer» C. o(n log n)


discuss

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

A. finding factorial

B. tower of hanoi

C. infix to postfix conversion

D. all of the above

Answer» B. tower of hanoi


discuss

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

A. queue

B. stack

C. tree

D. graph

Answer» B. stack
discuss

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

A. linear

B. non linear

Answer» A. linear
281. A list which displays the relationship of adjacency between elements is said to be

C. linked list

D. trees

Answer» A. linear
discuss

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

A. abstract level

B. application level

C. implementation level

D. all of the above

Answer» C. implementation level


discuss

283. Which 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

Answer» D. none of the above


discuss

284. 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.

A. push, pop

B. pop, push

C. insert, delete

D. delete, insert

Answer» A. push, pop


discuss

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

A. the name of array

B. the data type of array

C. the first data from the set to be stored

D. the index set of the array

Answer» C. the first data from the set to be stored


discuss

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

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

B. the architecture of computer memory does not allow arrays to store other than serially

C. both of above

D. none of above

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

287. Linked lists are best suited

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

D. for none of above situation

Answer» B. for the size of the structure and the data in the structure are constantly changing
discuss

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

A. traversal

B. search

C. sort

D. none of above

Answer» B. search
discuss

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

A. sorting

B. merging

C. inserting

D. traversal

Answer» D. traversal
discuss
290. Arrays 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

D. for none of above situatio

Answer» A. for relatively permanent collections of data


discuss

291. 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.

A. i-only

B. ii-only

C. both i and ii

D. none of the above

Answer» C. both i and ii


discuss

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

A. 5

B. 6

C. 4

D. none of the above

Answer» C. 4
discuss

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

A. insertion

B. deletion

C. retrieval

D. traversal

Answer» D. traversal
discuss

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

A. linked lists

Answer» D. dequeue
294. A data structure where elements can be added or removed at either end but not in the middle is called …

B. stacks

C. queue

D. dequeue

Answer» D. dequeue
discuss

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

A. fifo lists

B. lifo list

C. piles

D. push-down lists

Answer» A. fifo lists


discuss

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

A. array

B. lists

C. stacks

D. all of the above

Answer» C. stacks
discuss

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

A. stacks

B. queue

C. dequeue

D. binary search tree

Answer» B. queue
discuss

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

A. node.next inaccessible

B. node.next.next inaccessible

C. this node inaccessible

D. none of the above

Answer» A. node.next inaccessible


discuss

299. A circular linked list can be used for

A. stack

B. queue

C. both stack & queue

D. neither stack or queue

Answer» C. both stack & queue


discuss

300. In doubly linked lists

A. a pointer is maintained to store both next and previous nodes.

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

C. a pointer to self is maintained for each node.

D. none of the above

Answer» B. two pointers are maintained to store next and previous nodes.
discuss
More MCQs

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

A. singly linked list

B. circular linked list

C. doubly linked list

D. linear linked list

Answer» C. doubly linked list


discuss

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

A. underflow

B. overflow

C. housefull

D. saturated

Answer» A. underflow
discuss

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

A. only in forward direction

B. only in reverse direction

C. in both directions

D. none of the above

Answer» C. in both directions


discuss

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

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

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

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

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

Answer» 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; }
discuss
305. 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.

A. return data from the end of the list

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

C. returns the data from the beginning of the list

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

Answer» D. returns the data and deletes the node from the beginning of the list
discuss
306. 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;
}

A. return data from the end of the list

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

C. returns the data from the beginning of the list

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

Answer» B. returns the data and deletes the node at the end of the list
discuss

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

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

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

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

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

Answer» A. public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node);
head.setnext(node); size++; }
discuss
308. What is a dequeue?

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

B. a queue implemented with a doubly linked list

C. a queue implemented with both singly and doubly linked lists

D. a queue with insert/delete defined for front side of the queue

Answer» A. a queue with insert/delete defined for both front and rear ends of the queue
discuss

309. 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

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

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

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

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

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


discuss

310. 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?

A. a queue cannot be implemented using this stack.

B. a queue can be implemented where enqueue takes a single instruction and dequeue takes a sequence of two instructions.

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

D. a queue can be implemented where both enqueue and dequeue take a single instruction each.

Answer» C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single
instruction.
discuss
311. 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 ?

A. leaves the queue q unchanged

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

C. deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order

D. empties the queue q

Answer» B. reverses the order of the elements in the queue q


discuss

312. 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?

A. (ii) and (iii) are true

B. (i) and (ii) are true

C. (iii) and (iv) are true

D. (ii) and (iv) are true

Answer» A. (ii) and (iii) are true


discuss

313. Which of the following option is not correct?

if the queue is implemented with a linked list, keeping track of a front pointer, only rear pointer s will change during an
A.
insertion into an non-empty queue.

Answer» C. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault
algorithm.
313. Which of the following option is not correct?

B. queue data structure can be used to implement least recently used (lru) page fault algorithm and quick short algorithm.

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

D. both (a) and (c)

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

314. 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?

A. q[0]

B. q[1]

C. q[9]

D. q[10]

Answer» A. q[0]
discuss

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

A. create a node when free space pool is empty

B. traverse the nodes when free space pool is empty

C. create a node when linked list is empty

D. none of these

Answer» A. create a node when free space pool is empty


discuss

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

A. doubly linked list

B. singly linked list

C. circular linked list

D. hybrid linked list

Answer» D. hybrid linked list


discuss

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

A. static

Answer» B. dynamic
317. Linked list is generally considered as an example of _________ type of memory allocation.

B. dynamic

C. compile time

D. none of these

Answer» B. dynamic
discuss

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

A. pointer to class

B. pointer to an integer

C. pointer to character

D. pointer to node

Answer» D. pointer to node


discuss

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

A. 1036

B. 1028

C. 1038

D. none of these

Answer» D. none of these


discuss

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

A. 3

B. 4

C. 1

D. 2

Answer» D. 2
discuss

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

A. hollow

B. empty

C. finite

Answer» B. empty
321. If a list contains no elements it is said to be

D. infinite

Answer» B. empty
discuss

322. Linked list uses

A. random memory allocation

B. static memory allocation

C. fixed memory allocation

D. dynamic memory allocation

Answer» D. dynamic memory allocation


discuss

323. Standard approach for implementation of a list is/are of

A. 1 type

B. 2 type

C. 3 type

D. 4 type

Answer» B. 2 type
discuss

324. First link node of list is accessed from a pointer named

A. tail

B. head

C. terminator

D. initiator

Answer» B. head
discuss

325. A linked list is made up of a set of objects known as

A. nodes

B. arrays

C. entities

D. instances

Answer» A. nodes
discuss
326. How do you calculate the pointer difference in a memory efficient double linked list?

A. head xor tail

B. pointer to previous node xor pointer to next node

C. pointer to previous node – pointer to next node

D. pointer to next node – pointer to previous node

Answer» B. pointer to previous node xor pointer to next node


discuss

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

A. circular queue

B. random of queue

C. priority

D. dequeue

Answer» D. dequeue
discuss

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

A. fifo lists

B. lifo list

C. piles

D. push-down lists

Answer» A. fifo lists


discuss

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

A. arrays

B. stacks

C. queues

D. deque

Answer» D. deque
discuss

330. The postfix form of the expression (A + B)∗(C∗D − E)∗F / G is

A. ab + cd∗e − fg /∗∗

B. / ab + cd ∗ e − f ∗∗g /

Answer» A. ab + cd∗e − fg /∗∗


330. The postfix form of the expression (A + B)∗(C∗D − E)∗F / G is

C. ab + cd ∗ e − ∗f ∗ g /

D. ab + cde ∗ − ∗ f ∗ g /

Answer» A. ab + cd∗e − fg /∗∗


discuss

331. What is the postfix form of the following prefix expression -A/B*C$DE ?

A. abcde$*/-

B. a-bcde$*/-

C. abc$ed*/-

D. a-bcde$*/

Answer» A. abcde$*/-
discuss

332. The data structure required to evaluate a postfix expression is

A. queue

B. stacks

C. array

D. linked-list

Answer» B. stacks
discuss

333. What is the postfix form of the following prefix: *+ab–cd

A. ab+cd–*

B. abc+*–

C. ab+*cd–

D. ab+*cd–

Answer» A. ab+cd–*
discuss

334. A queue is a,

A. fifo (first in first out) list

B. lifo (last in first out) list

C. ordered array

D. linear tree

Answer» A. fifo (first in first out) list


discuss
335. In stack terminology, the __________operations are known as push and pop operations respectively.

A. delete

B. insert

C. both (a) and (b)

D. none of the above

Answer» C. both (a) and (b)


discuss

336. A common example of a queue is people waiting in line at a__________.

A. bus stop

B. movie hall

C. shopping mall

D. none of the above

Answer» A. bus stop


discuss

337. What is one of the common examples of a stack?

A. a pile of books

B. bus stop

C. a basket of fruits

D. a carat of eggs

Answer» A. a pile of books


discuss

338. When a stack is organized as an array, a variable named Top is used to point to the top element of the
stack. Initially, the value of Top is set to_______to indicate an empty stack.

A. -1

B. 0

C. 1

D. x

Answer» A. -1
discuss

339. What happens when the stack is full and there is no space for a new element, and an attempt is made to
push a new element?

A. overflow

Answer» A. overflow
339. What happens when the stack is full and there is no space for a new element, and an attempt is made to
push a new element?

B. underflow

C. top

D. none of the above

Answer» A. overflow
discuss

340. The total number of elements in a stack at a given point of time can be calculated from the value of______.

A. overflow

B. top

C. queues

D. underflow

Answer» B. top
discuss

341. When the push operation is performed on stack the value of TOS will be ______

A. decrement

B. increment

C. one

D. none of these

Answer» B. increment
discuss

342. A double linked list contains reference to _____

A. previous node

B. next node

C. current node

D. both a & b

Answer» D. both a & b


discuss

343. Data Structure that are created by user as per their requirement are known as

A. primitive data structure

B. non-primitive data structure

C. both a & b

Answer» A. primitive data structure


343. Data Structure that are created by user as per their requirement are known as

D. none of these

Answer» A. primitive data structure


discuss

344. To insert element at start, the previous pointer of newly added node would point to ______

A. null

B. next node

C. new node

D. head node

Answer» A. null
discuss

345. In linked list implementation, a node carries information regarding

A. the data

B. the link

C. both a & b

D. none of these

Answer» C. both a & b


discuss

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

A. strings

B. stack

C. queue

D. all of these

Answer» D. all of these


discuss

347. Stack is ____ type of data structure.

A. lifo

B. fifo

C. both a & b

D. none of these

Answer» A. lifo
discuss
348. In stack deletion operation is referred as _____

A. push

B. pop

C. peek

D. none of these

Answer» B. pop
discuss

349. Queue is _____ type of data structure.

A. lifo

B. fifo

C. both a & b

D. none of these

Answer» B. fifo
discuss

350. Data structre is divided into _____ parts.

A. 4

B. 3

C. 2

D. 1

Answer» C. 2
discuss
More MCQs

351. In ___ Data Structure data can be processed one by one sequentially

A. array

B. linked list

C. tree

D. none of these

Answer» B. linked list


discuss

352. When we insert an element in Queue, which pointer is increased by one?

A. front

B. rear

C. both a & b

D. none of these

Answer» B. rear
discuss

353. Which of the following is not the possible operation on stack?

A. push

B. pop

C. display

D. enqueue

Answer» D. enqueue
discuss

354. Which of the following is a possible operation on queue?

A. push

B. pop

C. display

D. enqueue

Answer» D. enqueue
discuss

355. In stack, to display the lastly inserted element without removing it, which function is used?

A. push

Answer» D. peek
355. In stack, to display the lastly inserted element without removing it, which function is used?

B. pop

C. display

D. peek

Answer» D. peek
discuss

356. if there are no nodes in linked list then start pointer will point at which value?

A. null

B. garbage

C. 1

D. 2

Answer» A. null
discuss

357. Worst space complexity of queue data structure is

A. o(n)

B. o(log(n))

C. o(1)

D. n/a

Answer» A. o(n)
discuss

358. Worst space complexity of stack data structure is

A. o(log(n))

B. o(1)

C. n/a

D. o(n)

Answer» D. o(n)
discuss

359. A ___________refers to a single unit of values.

A. data value.

B. attribute value.

C. data item.

Answer» C. data item.


359. A ___________refers to a single unit of values.

D. elementary.

Answer» C. data item.


discuss

360. Data items that are divided into subitems are called ___________.

A. single items.

B. group items.

C. elementary items.

D. entity items.

Answer» B. group items.


discuss

361. Which of these best describes an array?

A. A data structure that shows a hierarchical behavior

B. Container of objects of similar types

C. Container of objects of mixed types

D. All of the mentioned

Answer» B. Container of objects of similar types


discuss

362. In _______________all the records contain the same data items with the same amount of space.

A. variable-length records.

B. fixed-length records.

C. subscripted variable.

D. superscripted variable.

Answer» B. fixed-length records.


discuss

363. The logical or mathematical model of a particular organization of data is called a _______________.

A. data structure.

B. algorithms.

C. structure.

D. logic structure.

Answer» A. data structure.


discuss
364. Arrays are best data structures for _____________________________.

A. relatively permanent collections of data.

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

C. both of above situation.

D. None of the above.

Answer» A. relatively permanent collections of data.


discuss

365. How do the nested calls of the function get managed?

A. Through Queues.

B. Through Stacks.

C. Through Trees.

D. Through Graphs.

Answer» B. Through Stacks.


discuss

366. __________is combining the records in two different sorted files in to a single sorted file.

A. Sorting.

B. Searching.

C. Listing.

D. Merging.

Answer» D. Merging.
discuss

367. In linear search algorithm the Worst case occurs when ____________.

A. The item is somewhere in the middle of the array.

B. The item is not in the array at all.

C. The item is the last element in the array.

D. The item is the last element in the array or is not there at all.

Answer» D. The item is the last element in the array or is not there at all.
discuss

368. The complexity of Binary search algorithm is ____________.

A. O(n).

B. O(log n ).

C. O(n2).

Answer» B. O(log n ).
368. The complexity of Binary search algorithm is ____________.

D. O(n log n).

Answer» B. O(log n ).
discuss

369. The complexity of Bubble sort algorithm is _________.

A. O(n).

B. O(log n).

C. O(n2).

D. O(n log n).

Answer» C. O(n2).
discuss

370. Inorder traversal of binary search tree will produce _______________.

A. unsorted list.

B. sorted list.

C. reverse of input.

D. none of these.

Answer» B. sorted list.


discuss

371. Sub algorithms fall into two basic categories: function sub algorithms and ____________ sub algorithms.

A. procedure.

B. argument.

C. processor.

D. methods.

Answer» A. procedure.
discuss

372. Two main measures for the efficiency of an algorithm are____________.

A. Processor and memory.

B. Complexity and capacity.

C. Time and space.

D. Data and space.

Answer» C. Time and space.


discuss
373. New data are to be inserted into a data structure, but there is no available space; this situation is usually
called__________.

A. Underflow.

B. Overflow.

C. Houseful.

D. Saturated.

Answer» B. Overflow.
discuss

374. Which of the following data structure is linear data structure?

A. Tree.

B. Graph.

C. Array.

D. Linked list.

Answer» C. Array.
discuss

375. Which of the following is an example of dynamic programming approach?

A. Fibonacci Series

B. Tower of Hanoi

C. Dijkstra Shortest Path

D. All of the above

Answer» D. All of the above


discuss

376. The memory address of the first element of an array is called_________.

A. floor address.

B. foundation address.

C. first address.

D. base address.

Answer» D. base address.


discuss

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

A. Stacks.

B. Queues.

Answer» B. Queues.
377. Which data structure allows deleting data elements from front and inserting at rear?

C. Dequeues.

D. Binary search tree.

Answer» B. Queues.
discuss

378. Binary search algorithm cannot be applied to________ concept.

A. unsorted linked list.

B. sorted binary trees.

C. sorted linear array.

D. pointer array.

Answer» A. unsorted linked list.


discuss

379. Graph traversal is different from a tree traversal, because

A. trees are not connected.

B. graphs may have loops.

C. trees have root.

D. None is true as tree is a subset of graph.

Answer» C. trees have root.


discuss

380. Linked lists are suitable for which of the following problems?

A. Insertion sort

B. Binary search

C. Radix sort

D. dequeue.

Answer» B. Binary search


discuss

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

A. Input-restricted dequeue.

B. Output-restricted dequeue.

C. Priority queues.

D. Data structure.

Answer» A. Input-restricted dequeue.


discuss

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

A. Strings.

B. Lists.

C. Stacks.

D. Hierarchical.

Answer» D. Hierarchical.
discuss

383. To represent hierarchical relationship between elements, which data structure is suitable?

A. Dequeue.

B. Priority.

C. Tree.

D. Binary tree.

Answer» C. Tree.
discuss

384. When does the ArrayIndexOutOfBoundsException occur?

A. Compile-time

B. Run-time

C. Not an error

D. None of the mentioned

Answer» B. Run-time
discuss
385. The depth of a complete binary tree is given by__________.

A. Dn = n log2n.

B. Dn = n log2n+1.

C. Dn = log2n.

D. Dn = log2n+1.

Answer» D. Dn = log2n+1.
discuss

386. When converting binary tree into extended binary tree, all the original nodes in binary tree are___________.

A. internal nodes on extended tree.

B. external nodes on extended tree.

C. vanished on extended tree.

D. post order traversal.

Answer» A. internal nodes on extended tree.


discuss

387. Which of the following conditions checks available free space in avail list?

A. Avail=Top

B. Null=Avail

C. Avail=Null

D. Avail=Max stack

Answer» C. Avail=Null
discuss

388. Which of the following sorting algorithm is of divide-and-conquer type?

A. Bubble sort.

B. Insertion sort.

C. Quick sort.

D. Algorithm.

Answer» C. Quick sort.


discuss

389. STACK is also called as ______________.

A. FIFO

B. LIFO

Answer» B. LIFO
389. STACK is also called as ______________.

C. FOLI

D. FOFI

Answer» B. LIFO
discuss

390. Collection of related data items is called _______.

A. files

B. fields

C. attributes.

D. records.

Answer» D. records.
discuss

391. Breadth First search is used in____________.

A. binary tree.

B. stacks.

C. graphs.

D. both a and c.

Answer» C. graphs.
discuss

392. A variable whose size is determined at compile time and cannot be changed at run time is_________.

A. static variable.

B. dynamic variable.

C. not a variable.

D. data variable.

Answer» A. static variable.


discuss

393. Process of inserting an element in stack is called ____________.

A. Create

B. Push

C. Evaluation

D. Pop

Answer» B. Push
discuss
394. Length of linear array can be found by using the formula_________

A. UB-LB+1

B. LB+UB

C. LB-UB

D. LB-UB+1

Answer» A. UB-LB+1
discuss

395. The average number of key comparisons done in a successful sequential search in a list of length n
is___________.

A. log n

B. n-1/2.

C. n/2.

D. n+1/2.

Answer» D. n+1/2.
discuss

396. A technique for direct search is _______________.

A. Binary Search

B. Linear Search

C. Tree Search

D. Hashing

Answer» D. Hashing
discuss

397. Base address is the address of __________.

A. first element

B. middle element

C. last element

D. pivot element

Answer» A. first element


discuss

398. A _____________ list is a list where the last node contains null pointer.

A. circular header.

B. grounded header.

Answer» B. grounded header.


398. A _____________ list is a list where the last node contains null pointer.

C. rounded header.

D. linked header.

Answer» B. grounded header.


discuss

399. ___________are used to facilitate the processing of information in an array.

A. Pointers.

B. Memory location.

C. Records.

D. Variables.

Answer» A. Pointers.
discuss

400. The comparison tree is also called as________.

A. decision tree.

B. binary tree.

C. sequential tree.

D. b+ tree.

Answer» A. decision tree.


discuss
More MCQs

401. A linked list whose last node points back to the list node instead of containing the null pointer________.

A. circular list.

B. linked list.

C. circular doubly linked list.

D. doubly linked list.

Answer» A. circular list.


discuss

402. __________________ is a header list where the last node contains the null pointer.

A. Circular Header linked list

B. Grounded Header Linked list

C. Linked list

D. Linear Array

Answer» B. Grounded Header Linked list


discuss

403. Which of the following case does not exist in complexity theory

A. Best case

B. Worst case

C. Average case

D. Null case

Answer» D. Null case


discuss

404. The _________ for a linked list is a pointer variable that locates the beginning of the list.

A. anchor.

B. base.

C. footer.

D. header.

Answer» D. header.
discuss

405. The time factor when determining the efficiency of algorithm is measured by____________.

A. counting microseconds.

Answer» B. counting the number of key operations.


405. The time factor when determining the efficiency of algorithm is measured by____________.

B. counting the number of key operations.

C. counting the number of statements.

D. counting the kilobytes of algorithm.

Answer» B. counting the number of key operations.


discuss

406. The space factor when determining the efficiency of 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.

D. counting the maximum disk space needed by the algorithm.

Answer» A. counting the maximum memory needed by the algorithm.


discuss

407. 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.

Answer» D. item is the last element in the array or is not there at all.
discuss

408. The complexity of linear search algorithm is____________.

A. O(log n).

B. O(n).

C. O(n2).

D. O(n log n).

Answer» B. O(n).
discuss

409. The time required in best case for search operation in binary tree is ____________.

A. O(n).

B. O(2n).

C. O(log n).

Answer» C. O(log n).


409. The time required in best case for search operation in binary tree is ____________.

D. O( log 2n).

Answer» C. O(log n).


discuss

410. Which of the following way follows in Post order traversal?

A. Root -> Left sub tree -> Right sub tree.

B. Root -> Right sub tree -> Left sub tree.

C. Left sub tree -> Root -> Right sub tree.

D. Left sub tree -> Right sub tree -> Root.

Answer» D. Left sub tree -> Right sub tree -> Root.
discuss

411. A _________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.

Answer» C. Header Linked List.


discuss

412. _______________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.

Answer» D. Circular Header List.


discuss

413. The 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.

Answer» A. two-way circular header list.


discuss
414. The pointer of the last node contains a special value called_____________.

A. null pointer.

B. index pointer.

C. pointer link.

D. address pointer.

Answer» B. index pointer.


discuss

415. The OS of a computer may periodically collect all the deleted space onto the free storage list. This
technique is called______________.

A. buffering.

B. garbage collection.

C. deal location.

D. buffer collection.

Answer» B. garbage collection.


discuss

416. Important part of any compiler is the construction and maintenances of a dictionary, this types of
dictionary are called______________.

A. symbol table.

B. index table.

C. grammar table.

D. pointer table.

Answer» A. symbol table.


discuss

417. The data structure required to check whether an expression contains balanced parenthesis is?

A. queue

B. stack

C. linked list

D. file

Answer» B. stack
discuss

418. What are the advantages of arrays?

A. Easier to store elements of same data type

Answer» D. All of the mentioned


418. What are the advantages of arrays?

B. Used to implement other data structures like stack and queue

C. Convenient way to represent matrices as a 2D array

D. All of the mentioned

Answer» D. All of the mentioned


discuss

419. The number of possible ordered trees with three nodes A,B,C is?

A. 16

B. 12.

C. 10

D. 6

Answer» B. 12.
discuss

420. The earliest use of__________ sorting was in conjunction with network analysis.

A. topological.

B. bubble.

C. radix.

D. heap.

Answer» A. topological.
discuss

421. _________is not the operation that can be performed on Queue.

A. Traversal.

B. Insertion.

C. Deletion.

D. Retrieval.

Answer» A. Traversal.
discuss

422. A tree is a finite set of_________.

A. loops.

B. domains.

C. functions.

Answer» D. nodes.
422. A tree is a finite set of_________.

D. nodes.

Answer» D. nodes.
discuss

423. Stack can be represented by means of ____________.

A. Tree.

B. Graph.

C. One-way List.

D. None.

Answer» C. One-way List.


discuss

424. The hashing file space is divided into_______________.

A. nodes and roots.

B. roots and slots.

C. buckets and slots.

D. slots and nodes.

Answer» C. buckets and slots.


discuss

425. Matrices with a relatively high proportion of zero entries are called _______ matrices.

A. sparse.

B. Null.

C. Zero.

D. worse.

Answer» A. sparse.
discuss

426. The Postfix equivalent of the Prefix Notation * + ab - cd is

A. ab + cd - *

B. abcd +-*

C. ab+cd*-

D. ab+-cd*

Answer» A. ab + cd - *
discuss
427. Data structure which is capable of expressing more complex relationship than that of physical adjacency is
called______________.

A. linear data structure.

B. linked list.

C. non linear data Structure

D. data structure.

Answer» C. non linear data Structure


discuss

428. A tree is a data structure which represents hierarchical relationship between individual _________.

A. data items.

B. fields.

C. nodes.

D. linked list.

Answer» A. data items.


discuss

429. In 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.

Answer» D. a leaf.
discuss

430. In 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.

Answer» C. ordered.
discuss

431. ______________ a tree means processing it in such a way that each node is visited only once.

A. Traversing.

Answer» A. Traversing.
431. ______________ a tree means processing it in such a way that each node is visited only once.

B. Implement.

C. Partition.

D. Node.

Answer» A. Traversing.
discuss

432. The length of the path is the number of_____________ on the path.

A. nodes.

B. fields.

C. data.

D. edges.

Answer» D. edges.
discuss

433. The children node of same parent is called____________.

A. binary tree.

B. tree.

C. sibling.

D. list.

Answer» C. sibling.
discuss

434. The situation in linked list START = NULL is called_________

A. Overflow

B. Underflow

C. Zero

D. None of the above

Answer» B. Underflow
discuss

435. A code which deals about short form of a program is called __________ code.

A. program.

B. data.

C. pseudo.

Answer» C. pseudo.
435. A code which deals about short form of a program is called __________ code.

D. derived.

Answer» C. pseudo.
discuss

436. Which of the application may use a stack?

A. Expression Evaluation

B. Keeping track of local variables at run time.

C. Syntax analyzer for a compiler

D. All of the above.

Answer» A. Expression Evaluation


discuss

437. The queue which wraps around upon reaching the end of the array is called as____________.

A. circular queue.

B. linked queue.

C. doubly linked list.

D. representation of queue.

Answer» A. circular queue.


discuss

438. A _______________ is a reference to a memory location, which is used to store data that is described in a data
type.

A. element.

B. variable.

C. pointer.

D. memory.

Answer» B. variable.
discuss

439. If the elements A, B, C and D are placed in a stack and are deleted one at a time, what is the order of
removal?

A. ABCD

B. DCBA

C. DCAB

D. ABDC

Answer» B. DCBA
discuss

440. ____________ has certain attributes or properties which may be assigned values.

A. field system.

B. record.

C. entity.

D. files.

Answer» C. entity.
discuss

441. The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is
____________.

A. 6

B. 5

C. 7

D. 8

Answer» B. 5
discuss

442. Maximum degree in any vector in a graph with n vertices is ________.

A. n.

B. n-1.

C. n+1.

D. 2n+1.

Answer» B. n-1.
discuss

443. If FRONT = NULL then _________.

A. queue full

B. queue empty

C. dequeue

D. priority queue

Answer» B. queue empty


discuss
444. _______________ is a solution to a problem independent of programming language.

A. Efficient.

B. Linked list.

C. Data structure.

D. Algorithm.

Answer» D. Algorithm.
discuss

445. ________ is the situation where data-structure is empty.

A. Overflow.

B. Underflow.

C. Null.

D. Empty.

Answer» B. Underflow.
discuss

446. When elements are deleted the nodes go to_________.

A. registers.

B. free pool.

C. recycle bin.

D. gets deleted permanently.

Answer» B. free pool.


discuss

447. Expression into postfix expression: (A - B) * (D / E)

A. ABDE - * /

B. - * / ABDE

C. A B - D E * /

D. * - A B / D E

Answer» D. * - A B / D E
discuss

448. Each data item in a record may be a group item composed of sub-items; those items which are
indecomposable are called ________

A. elementary items.

B. atoms.

Answer» D. structure.
448. Each data item in a record may be a group item composed of sub-items; those items which are
indecomposable are called ________

C. scalars.

D. structure.

Answer» D. structure.
discuss

449. Quick sort uses ____ for implementation.

A. recursion.

B. traversal.

C. heaps.

D. queues.

Answer» A. recursion.
discuss

450. What 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²).

Answer» C. O(n log n).


discuss
More MCQs

451. The __________________ denotes the greatest integer.

A. ceiling.

B. time.

C. space.

D. floor.

Answer» A. ceiling.
discuss

452. A binary tree of depth "d" is an almost complete binary tree if __________.

A. each leaf in the tree is either at level.

B. for any node.

C. both a and b.

D. None.

Answer» C. both a and b.


discuss

453. Program module contains its own list of variables called ____________.

A. global.

B. scope.

C. local.

D. external.

Answer» C. local.
discuss

454. The number of nodes in a complete binary tree of level 5 is__________.

A. 15.

B. 20.

C. 63.

D. 31.

Answer» D. 31.
discuss

455. The string with zero characters is called___________.

A. null string.

Answer» D. empty string.


455. The string with zero characters is called___________.

B. zero string.

C. one string.

D. empty string.

Answer» D. empty string.


discuss

456. The unit equal to the number of bits needed to represent a character is called a ________.

A. byte.

B. bit.

C. mega bytes.

D. kilo bytes.

Answer» A. byte.
discuss

457. The number of swapping needed to sort numbers 8,22,7,9,31,19,5,13 in ascending order using bubble sort
is ?

A. 11

B. 12

C. 13

D. 14

Answer» D. 14
discuss

458. In variable length storage two dollar signs are used to signal the __________.

A. end of the string.

B. beginning of the string.

C. mid-level of the string.

D. index.

Answer» A. end of the string.


discuss

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

A. 2 deletions and 3 additions

B. 3 additions and 2 deletions

Answer» C. 3 deletions and 3 additions


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

C. 3 deletions and 3 additions

D. 3 deletions and 4 additions

Answer» C. 3 deletions and 3 additions


discuss

460. Each node in a singly linked lists have ______ fields

A. 2

B. 3

C. 4

D. 5

Answer» A. 2
discuss

461. Quotation marks are also called as ____________.

A. string delimiters.

B. period.

C. stopper.

D. string.

Answer» A. string delimiters.


discuss

462. A string `s` consists of x, y and if x is an empty string then y is called as___________.

A. initial substring.

B. substring of s.

C. node of the string.

D. index.

Answer» A. initial substring.


discuss

463. The length of the string can be listed as an additional item in _____________.

A. base pointer.

B. pointer array.

C. node.

D. record.

Answer» B. pointer array.


discuss

464. Who invented Quick sort procedure?

A. Hoare.

B. Sedgewick.

C. Mellroy.

D. Coreman.

Answer» A. Hoare.
discuss

465. For the heap sort, access to nodes involves simple _______________ operations.

A. binary.

B. arithmetic

C. algebraic

D. logarithmic

Answer» B. arithmetic
discuss

466. The maximum number of nodes on level i of a binary tree is ___________.

A. 2i-1.

B. 3i-1.

C. i+1.

D. 2i+1.

Answer» A. 2i-1.
discuss

467. The number of edges in a regular graph of degree d and n vertices is _______.

A. maximum of n,d.

B. n+d.

C. nd.

D. nd/2.C

Answer» C. nd.
discuss

468. Which of the following is useful in traversing a given graph by Breath first search?

A. Stack.

Answer» D. Queue.
468. Which of the following is useful in traversing a given graph by Breath first search?

B. Set.

C. List.

D. Queue.

Answer» D. Queue.
discuss

469. What is an external sorting algorithm?

A. Algorithm that uses tape or disk during the sort

B. Algorithm that uses main memory during the sort

C. Algorithm that involves swapping

D. Algorithm that are considered in place

Answer» A. Algorithm that uses tape or disk during the sort


discuss

470. Allocating memory for arrays during program compilation is___________.

A. dynamic memory allocation.

B. memory allocation.

C. static allocation.

D. random allocation.

Answer» C. static allocation.


discuss

471. The elements of an array are allocated in spaces________.

A. successively.

B. randomly.

C. alternately.

D. on any order.

Answer» A. successively.
discuss

472. Accessing and processing each array elements is called __________.

A. sorting.

B. traversing.

C. searching.

Answer» B. traversing.
472. Accessing and processing each array elements is called __________.

D. merging.

Answer» B. traversing.
discuss

473. An m*n array has _________number of elements.

A. m.

B. n.

C. m2.

D. m*n.

Answer» D. m*n.
discuss

474. The sequence (1,1) (2,1) (3,1) (1,2) (2,2) (3,2) . . . .represents _________.

A. row major order.

B. column major order.

C. random order.

D. successive order.

Answer» B. column major order.


discuss

475. ______ is not a technique of tree traversal.

A. pre-order

B. post-order

C. prefix

D. in-order

Answer» C. prefix
discuss

476. Selection sort and quick sort both fall into the same category of sorting algorithms._________ is that
category.

A. O(n log n) sorts.

B. Divide-and-conquer sorts.

C. Interchange sorts.

D. Average time is quadratic.

Answer» C. Interchange sorts.


discuss
477. The possibility of two different keys k1 & k2 yielding the same hash address is called__________.

A. merge.

B. obstacle.

C. overlapping.

D. collision.

Answer» C. overlapping.
discuss

478. Uniform 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.

Answer» A. reduce the number of collision.


discuss

479. An edge E is called _________ if it has identical endpoints.

A. multiple edges.

B. loops.

C. finite.

D. digraph.

Answer» B. loops.
discuss

480. __________involves maintaining two tables in memory.

A. Arranging.

B. Bonding.

C. Combing.

D. Chaining.

Answer» D. Chaining.
discuss

481. An _________ is a well defined list of steps for solving a problem.

A. Algorithm.

B. Program.

Answer» A. Algorithm.
481. An _________ is a well defined list of steps for solving a problem.

C. Procedure.

D. Process.

Answer» A. Algorithm.
discuss

482. The data items in a record form a ________ structure which can be described by means of level numbers.

A. hierarchical.

B. procedural.

C. indexed.

D. leveled.

Answer» A. hierarchical.
discuss

483. A path P of length n from a node u to a node v is defined as a sequence of _________ nodes.

A. n.

B. n+1.

C. n+2.

D. n-1.

Answer» B. n+1.
discuss

484. A vertex of degree one is called __________.

A. padent

B. isolated vertex

C. null vertex

D. colored vertex

Answer» A. padent
discuss

485. A connected graph T without any cycles is called _____________.

A. a tree graph.

B. free tree.

C. a tree.

D. all of the above.

Answer» D. all of the above.


discuss
486. If every node u in G is adjacent to every other node v in G, A graph is said to be _______.

A. isolate.

B. complete.

C. finite.

D. Strongly connected.

Answer» B. complete.
discuss

487. In a graph G if e=(u,v), then u and v are called ___________.

A. endpoints.

B. adjacent nodes.

C. neighbours.

D. all of the above.

Answer» D. all of the above.


discuss

488. Which of the following is true while inserting a new node in the list?

A. Check there is node in the list.

B. Check in the free node in the pool.

C. There is no node.

D. Underflow.

Answer» B. Check in the free node in the pool.


discuss

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

A. Linear arrays.

B. Linked lists.

C. Arrays.

D. First address.

Answer» A. Linear arrays.


discuss

490. The efficiency of a BFS algorithm is dependent on _______.

A. Algorithm.

B. Tree.

Answer» D. Graph.
490. The efficiency of a BFS algorithm is dependent on _______.

C. Problem.

D. Graph.

Answer» D. Graph.
discuss

491. The average number of key comparisons done in a successful sequential search in a list of length n is
____________.

A. log n.

B. n-1/2.

C. n/2.

D. n+1/2.

Answer» D. n+1/2.
discuss

492. Divide and conquer is an important algorithm design paradigm based on _______.

A. multi-branched recursion.

B. single-branched recursion.

C. two-way recursion.

D. None.

Answer» A. multi-branched recursion.


discuss

493. The correctness of a divide and conquer algorithm is usually proved by _________.

A. mathematical theorem.

B. de-Morgan `s law.

C. mathematical induction.

D. none.

Answer» C. mathematical induction.


discuss

494. The ____________ is used in an elegant sorting algorithm.

A. Heap sort.

B. Quick sort.

C. Merge sort.

D. Radix sort.

Answer» A. Heap sort.


discuss

495. ____________ is finding a path/tour through the graph such that every vertex is visited exactly once.

A. Travelling Salesman tour.

B. Eulerian tour.

C. Hamiltonian tour.

D. None.

Answer» C. Hamiltonian tour.


discuss

496. ____________ data structure is used to implement Depth First search.

A. Array.

B. Linked list.

C. Queue.

D. Stack.

Answer» D. Stack.
discuss

497. The binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree is

A. log2N

B. n-1

C. n

D. None of the above

Answer» B. n-1
discuss

498. Each entry in a linked list is a called a_______________.

A. Link.

B. Node.

C. Data Structure.

D. Avail.

Answer» B. Node.
discuss

499. Which of the following is two way lists?

A. Grounded header list.

Answer» D. List traversed in two directions.


499. Which of the following is two way lists?

B. Circular header list.

C. Linked list with header and trailer nodes.

D. List traversed in two directions.

Answer» D. List traversed in two directions.


discuss

500. A list that has no nodes is called________.

A. End list.

B. Zero list.

C. Null list.

D. Sentinel list.

Answer» C. Null list.


discuss
More MCQs

501. The special list which consists of unused memory space is called __________.

A. Free space.

B. Empty space.

C. Available space.

D. Free storage list.

Answer» D. Free storage list.


discuss

502. To insert a new node in linked list free node will be available in ___________.

A. Available list.

B. Avail list.

C. Free node list.

D. Memory space list.

Answer» B. Avail list.


discuss

503. A ______________ list is a header list where the node points back to the header node.

A. Circular header.

B. Grounded header.

C. Two way header.

D. One way header.

Answer» A. Circular header.


discuss

504. How many pointers are necessarily changed for the insertion in a Linked List?

A. 1.

B. 2.

C. 3.

D. 5.

Answer» B. 2.
discuss

505. An algorithm that calls itself directly or indirectly is known as ____________.

A. Sub algorithm. .

Answer» B. Recursion.
505. An algorithm that calls itself directly or indirectly is known as ____________.

B. Recursion.

C. Polish notation.

D. Traversal algorithm.

Answer» B. Recursion.
discuss

506. Minimum number of fields in each node of a doubly linked list is____

A. 2

B. 3

C. 4

D. None of the above

Answer» B. 3
discuss

507. A graph in which all vertices have equal degree is known as ____

A. Complete graph

B. Regular graph

C. Multi graph

D. Simple graph

Answer» A. Complete graph


discuss

508. A vertex of in-degree zero in a directed graph is called a/an

A. Root vertex

B. Isolated vertex

C. Sink

D. Articulation point

Answer» C. Sink
discuss

509. A graph is a tree if and only if graph is

A. Directed graph

B. Contains no cycles

C. Planar

Answer» B. Contains no cycles


509. A graph is a tree if and only if graph is

D. Completely connected

Answer» B. Contains no cycles


discuss

510. The elements of a linked list are stored

A. In a structure

B. In an array

C. Anywhere the computer has space for them

D. In contiguous memory locations

Answer» C. Anywhere the computer has space for them


discuss

511. A parentheses checker program would be best implemented using

A. List

B. Queue

C. Stack

D. Any of the above

Answer» C. Stack
discuss

512. To perform level-order traversal on a binary tree, which of the following data structure will be required?

A. Hash table

B. Queue

C. Binary search tree

D. Stack

Answer» B. Queue
discuss

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

A. Queue

B. Linked list

C. Binary search tree

D. None of above

Answer» D. None of above


discuss
514. A binary tree in which all its levels except the last, have maximum numbers of nodes, and all the nodes in
the last level have only one child it will be its left child. Name the tree.

A. Threaded tree

B. Complete binary tree

C. M-way search tree

D. Full binary tree

Answer» B. Complete binary tree


discuss

515. Which of following data structure is more appropriate for implementing quick sort iteratively?

A. Deque

B. Queue

C. Stack

D. Priority queue

Answer» C. Stack
discuss

516. The number of edges in a complete graph of n vertices is

A. n(n+1)/2

B. n(n-1)/2

C. n2/2

D. n

Answer» B. n(n-1)/2
discuss

517. If two trees have same structure and but different node content, then they are called ___

A. Synonyms trees

B. Joint trees

C. Equivalent trees

D. Similar trees

Answer» D. Similar trees


discuss

518. If two trees have same structure and node content, then they are called ____

A. Synonyms trees

B. Joint trees

Answer» C. Equivalent trees


518. If two trees have same structure and node content, then they are called ____

C. Equivalent trees

D. Similar trees

Answer» C. Equivalent trees


discuss

519. Finding the location of a given item in a collection of items is called ……

A. Discovering

B. Finding

C. Searching

D. Mining

Answer» C. Searching
discuss

520. Quick sort is also known as ……..

A. merge sort

B. tree sort

C. shell sort

D. partition and exchange sort

Answer» D. partition and exchange sort


discuss

521. ………. sorting is good to use when alphabetizing a large list of names.

A. Merge

B. Heap

C. Radix

D. Bubble

Answer» C. Radix
discuss

522. The total number of comparisons in a bubble sort is ….

A. O(n logn)

B. O(2n)

C. O(n2)

D. O(n)

Answer» A. O(n logn)


discuss
523. ……… form of access is used to add and remove nodes from a queue.

A. LIFO, Last In First Out

B. FIFO, First In First Out

C. Both a and b

D. None of these

Answer» B. FIFO, First In First Out


discuss

524. New nodes are added to the ……… of the queue.

A. Front

B. Back

C. Middle

D. Both A and B

Answer» B. Back
discuss

525. The term push and pop is related to

A. Array

B. Lists

C. Stacks

D. Trees

Answer» C. Stacks
discuss

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

A. finding factorial

B. tower of Hanoi

C. infix to postfix

D. all of the above

Answer» D. all of the above


discuss

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

A. sorting

B. merging

Answer» D. traversal
527. The operation of processing each element in the list is known as ……

C. inserting

D. traversal

Answer» D. traversal
discuss

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

A. Underflow

B. Overflow

C. Houseful

D. Saturated

Answer» A. Underflow
discuss

529. Which of the following are two-way lists?

A. Grounded header list

B. Circular header list

C. Linked list with header and trailer nodes

D. List traversed in two directions

Answer» D. List traversed in two directions


discuss

530. Which is the pointer associated with the availability list?

A. FIRST

B. AVAIL

C. TOP

D. REAR

Answer» B. AVAIL
discuss

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

A. Arrays

B. Records

C. Pointers

D. Stacks

Answer» A. Arrays
discuss
532. Which of the following is non-liner data structure?

A. Stacks

B. List

C. Strings

D. Trees

Answer» D. Trees
discuss

533. To represent hierarchical relationship between elements, which data structure is suitable?

A. Dequeue

B. Priority

C. Tree

D. Graph

Answer» C. Tree
discuss

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

A. Input restricted dequeue

B. Output restricted qequeue

C. Priority queues

D. Stack

Answer» A. Input restricted dequeue


discuss
https://www.youtube.com/@codewitharrays

https://www.instagram.com/codewitharrays/

https://t.me/codewitharrays Group Link: https://t.me/ccee2025notes

+91 8007592194 +91 9284926333

[email protected]

https://codewitharrays.in/project

You might also like