Data structures Objective Questions And Answers : Set-2

Data structres are commanly asked in Technical interviews.Here we have listed some Data structures questions with answers you can study these for your interview.Here You can make bold yourself in data structures.

Data structures Objective Questions And Answers : Set-1

OBJECTIVE TYPE QUESTIONS :

Q. 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$*/

Ans:A

Q. A full binary tree with n leaves contains

(A) n nodes. (B) log n 2 nodes.

(C) 2n –1 nodes. (D) n 2 nodes.

Ans:C

Q. A sort which relatively passes through a list to exchange the first element with any element

less than it and then repeats with a new first element is called

(A) insertion sort. (B) selection sort.

(C) heap sort. (D) quick sort.

Ans:D

Q. Which of the following sorting algorithms does not have a worst case running time of ( 2 ) O n ?

(A) Insertion sort (B) Merge sort

(C) Quick sort (D) Bubble sort

Ans:B

Q. An undirected graph G with n vertices and e edges is represented by adjacency list. What is

the time required to generate all the connected components?

(A) O (n) (B) O (e)

(C) O (e+n) (D) O ( 2 ) e

Ans:C

Q. Consider a linked list of n elements. What is the time taken to insert an element after an

element pointed by some pointer?

(A) O (1) (B) O (log2 n)

(C) O (n) (D) O (n log2 n)

Ans:A

Q. The smallest element of an array’s index is called its

(A) lower bound. (B) upper bound.

(C) range. (D) extraction.

Ans:A

Q. In a circular linked list

(A) components are all linked together in some sequential manner.

(B) there is no beginning and no end.

(C) components are arranged hierarchically.

(D) forward and backward traversal within the list is permitted.

Ans:B

Q. A graph with n vertices will definitely have a parallel edge or self loop of the total number of

edges are

(A) more than n (B) more than n+1

(C) more than (n+1)/2 (D) more than n(n-1)/2

Ans: D

Q. The minimum number of multiplications and additions required to evaluate the polynomial

P = 4×3+3×2-15x+45 is

(A) 6 & 3 (B) 4 & 2

(C) 3 & 3 (D) 8 & 3

Ans: C

Q. The maximum degree of any vertex in a simple graph with n vertices is

(A) n–1 (B) n+1

(C) 2n–1 (D) n

Ans: A

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

(A) queue (B) stack

(C) array (D) tree

Ans: A

Q. The quick sort algorithm exploit _________ design technique

(A) Greedy (B) Dynamic programming

(C) Divide and Conquer (D) Backtracking

Ans: C

Q. The number of different directed trees with 3 nodes are

(A) 2 (B) 3

(C) 4 (D) 5

Ans: B

Q. One can convert a binary tree into its mirror image by traversing it in

(A) inorder (B) preorder

(C) postorder (D) any order

Ans:C

Q. The total number of companions required to merge 4 sorted files containing 15, 3, 9 and 8

records into a single sorted file is

(A) 66 (B) 39

(C) 15 (D) 3

Ans: 33 (option is not available)

Q. In a linked list with n nodes, the time taken to insert an element after an element pointed by

some pointer is

(A) 0 (1) (B) 0 (log n)

(C) 0 (n) (D) 0 (n 1og n)

Ans:A

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

(A) queue (B) stack

(C) array (D) linked-list

Ans:B

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

(A) Stack (B) Queue

(C) Tree (D) Array

Ans:A

Q. The complexity of searching an element from a set of n elements using Binary search

algorithm is

(A) O(n) (B) O(log n)

(C) O(n2) (D) O(n log n)

Ans:B

Q. The number of leaf nodes in a complete binary tree of depth d is

(A) 2d (B) 2d–1+1

(C) 2d+1+1 (D) 2d+1

Ans:A

Q.What data structure would you mostly likely see in a nonrecursive implementation of a

recursive algorithm?

(A) Stack (B) Linked list

(C) Queue (D) Trees

Ans:A

Q. Which of the following sorting methods would be most suitable for sorting a list which is

almost sorted

(A) Bubble Sort (B) Insertion Sort

(C) Selection Sort (D) Quick Sort

Ans:A

Q. A B-tree of minimum degree t can maximum _____ pointers in a node.

(A) t–1 (B) 2t–1

(C) 2t (D) t

Ans:D

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

on a

(A) heap (B) queue

(C) stack (D) binary tree

Ans:C

Q. A graph with n vertices will definitely have a parallel edge or self loop if the total number of

edges are

(A) greater than n–1 (B) less than n(n–1)

(C) greater than n(n–1)/2 (D) less than n2/2

Ans:A

Q. A BST is traversed in the following order recursively: Right, root, left

The output sequence will be in

(A) Ascending order (B) Descending order

(C) Bitomic sequence (D) No specific order

Ans:B

Q. The pre-order and post order traversal of a Binary Tree generates the same output. The tree can

have maximum

(A) Three nodes (B) Two nodes

(C) One node (D) Any number of nodes

Ans:C

Q. The postfix form of A*B+C/D is

(A) *AB/CD+ (B) AB*CD/+

(C) A*BC+/D (D) ABCD+/*

Ans:B

Q. Let the following circular queue can accommodate maximum six elements with the

following data

front = 2 rear = 4

queue = _______; L, M, N, ___, ___

What will happen after ADD O operation takes place?

(A) front = 2 rear = 5

queue = ______; L, M, N, O, ___

(B) front = 3 rear = 5

queue = L, M, N, O, ___

(C) front = 3 rear = 4

queue = ______; L, M, N, O, ___

  (D) front = 2 rear = 4

queue = L, M, N, O, ___

Ans:A

This entry was posted in Data Structures, Freshers, Programing, Technical Interviews Questions and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>