# Data structure/Data Structure Multiple Choice Questions and Answers Sample Test,Sample questions

## Question: If yyy, xxx and zzz are the elements of a lexically ordered binary tree, then in pre-order traversal which node will be traverse first

1.xxx

2.yyy

3.zzz

4.cannot be determined

## Question: In a graph, if e=(u, v) means

1.u is adjacent to v but v is not adjacent to u

2.e begins at u and ends at v

3.u is processor and v is a successor

4.both b and c

## Question: In a graph, if e=[u, v], Then u and v are called

1.endpoints of e

3.neighbors

4.All of the above

1. 2

2.5

3.3

4.0

1.Dn = n log2n

2.Dn = n log2n+1

3.Dn = log2n

4. Dn = log2n+1

## Question: Two main measures for the efficiency of an algorithm are

1.Processor and memory

2.Complexity and capacity

3.Time and space

4.Data and space

## Question: When representing an algebraic expression E which uses only binary operations in a 2-tree,

1. When representing an algebraic expression E which uses only binary operations in a 2-tree,

2.the operations in E will appear as external nodes and variables in internal nodes

3.the variables and operations in E will appear only in internal nodes

4.the variables and operations in E will appear only in external nodes

## Question: Which of the following data structure is a linear type?

1.Strings

2.Lists

3.Queues

4.All of the above

1.3

2.Junk value

3.Run time error

## Question: . If every node u in G is adjacent to every other node v in G, A graph is said to be

1.isolated

2.complete

3.finite

4.strongly connected

## Question: A binary tree can easily be converted into q 2-tree

1.by replacing each empty subtree by a new internal node

2.by inserting an internal node for non-empty node

3. by inserting an external node for non-empty node

4.by replacing each empty subtree by a new external node

## Question: A binary tree can easily be converted into q 2-tree

1.by replacing each empty subtree by a new internal node

2.by inserting an internal node for non-empty node

3.by inserting an external node for non-empty node

4.by replacing each empty subtree by a new external node

## Question: A connected graph T without any cycles is called

1.a tree graph

2.free tree

3.a tree

4.All of the above

## Question: An algorithm that calls itself directly or indirectly is known as

1.Sub-algorithm

2.Recursion

3.Polish notation

4.Traversal algorithm

## Question: Identify the data structure which allows deletions at both ends of the list but insertion at only one ending.

1.Input-restricted deque

2. Output-restricted deque

3.Priority Queues

4.None of the above

## Question: If the out-degree of every node is exactly equal to M or 0 and the number of nodes at level K is Mk-1 [con sider root at level 1], the tree is called as(i) Full m-ary try (ii) Complete m-ary tree (iii)Positional m-ary tree

1. Only (i)

2.Only (ii)

3.Both (i) and (ii)

4.Both (ii) and (III)

1.2

2.1

3.9

4.3

1.Leaf

2.branch

3.path

## Question: In a Heap tree

1.Values in a node are greater than every value in the left subtree and smaller than right subtree

2.Values in a node are greater than every value in children of it

3.Both of the above conditions apply

4.None of the above conditions applies

## Question: In a Stack, the command to access an nth element from the top of the stack s will be

1.S[Top-n]

2.S [Top+n]

3. S [top-n-1]

4.None of the above

## Question: The Average case occur in the linear search algorithm

1. When Item is somewhere in the middle of the array

2.When Item is not in the array at all

3.When Item is the last element in the array

4.When Item is the last element in the array or is not there at all

1.O(n)

2.O(log )

3.O(n2)

4.O(n log n)

1.O(n)

2. O(log n)

3. O(n2)

4. O(n log n)

## Question: The complexity of the average case of an algorithm is

1.Much more complicated to analyze than that of a worst case

2. Much simpler to analyze than that of the worst case

3.Sometimes more complicated and some other times simpler than that of the worst case

4.None of the above

## Question: The complexity of the linear search algorithm is

1. O(n)

2. O(log n)

3.O(n2)

4. O(n log n)

1.First record of the actual data

2. Last record of the actual data

3.Pointer to the last record of the actual data

4.None of the above

## Question: The in order traversal of the tree will yield a sorted listing of elements of tree in

1.Binary trees

2.Binary search trees

3.Heaps

4.None of the above

1.ABFCDE

3.ABDECF

4.ABDCEF

1.0

2.5

3.10

4.15

## Question: The space factor when determining the efficiency of the algorithm is measured by

1.Counting the maximum memory needed by the algorithm

2.Counting the minimum memory needed by the algorithm

3.Counting the average memory needed by the algorithm

4.Counting the maximum disk space needed by the algorithm

## Question: The space factor when determining the efficiency of the algorithm is measured by

1. Counting the maximum memory needed by the algorithm

2.Counting the minimum memory needed by the algorithm

3.Counting the average memory needed by the algorithm

4.Counting the maximum disk space needed by the algorithm

## Question: The time factor when determining the efficiency of the algorithm is measured by

1. Counting microseconds

2.Counting the number of key operations

3.Counting the number of statements

4.Counting the kilobytes of algorithm

## Question: The total number of comparisons in a bubble sort is

1.O(n log n)

2.O(2n)

3.O(n2)

4.None of the above

## Question: The Worst case occur in the linear search algorithm when

1.Item is somewhere in the middle of the array

2.Item is not in the array at all

3. Item is the last element in the array

4.Item is the last element in the array or is not there at all

## Question: To represent the hierarchical relationship between elements, which data structure is suitable?

1.Deque

2.Priority

3.Tree

4.All of the above

## Question: When converting a binary tree into an extended binary tree, all the original nodes in the binary tree are

1. internal nodes on extended tree

2.external nodes on extended tree

3.vanished on extended tree

4.None of the above

## Question: Which data structure allows deleting data elements from front and inserting at the rear?

1.Stacks

2.Queues

3.Deques

4.Binary search tree

1.Best case

2.Worst case

3.Average case

4.Null case

## Question: Which of the following data structure is non-linear type?

1.Strings

2.Lists

3.Stacks

4.None of the above

## Question: Which of the following sorting algorithm is of divide-and-conquer type?

1.Bubble sort

2.Insertion sort

3.Quicksort

4.All of the above

## More MCQS

##### R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!