Você está na página 1de 24

Data Structures and Algorithms Question Bank

UNIT I
PART - A
1. What do you meant by data structure?
2. List out the areas in which data structures are applied extensively.
3. Define algorithm.
. Define program.
!. What is a pointer?
". Define self#referential structure.
$. What are the different types of data structure?
%. Define linear data structure and &ive some examples.
'. What is meant by an abstract data type?
1(. What are the operations of )D*?
11. Difference between array and list.
12. What is an ordered list?
13. What is meant by list )D*?
1. What are the various operations done under list )D*?
1!. What are the different ways to implement list?
1". What are the advantages in the array implementation of list?
1$. What are the disadvantages of array implementation of List?
1%. +ow do you overcome the difficulties of array implementation of list?
1'. What is a dummy header and why do we use it?
2(. What is a lin,ed list? &ive one example.
21. List the advantages and disadvantages of Lin,ed List.
22. What do you mean by circular lin,ed list? &ive an example.
23. Discuss the use of circular lin,ed list
2. What is the problem in using circular lin,ed list? +ow can you overcome it?
2!. What is a doubly lin,ed list or two#way chain?
2". Define double circularly lin,ed list?
2$. Why do we use doubly lin,ed list? -tate the advantages of doubly lin,ed list
over singly lin,ed list.
2%. What is cursor implementation of lin,ed list?
2'. List the applications of Lin,ed List.
3(. What is a stac,?
31. What are the various operations performed on the stac,?
32. .s it possible to have more than one stac, in an array.
33. What is meant by overflow and underflow condition in a stac,?
3. /ame any two applications of stac,?
3!. Define 0ueues.
3". What are the various operations performed on the 0ueue?
3$. +ow do you test for an empty 1ueue?
3%. List the applications of 1ueue.
3'. Write down the operations that can be done with 1ueue data structure?
(. What is a circular 1ueue?
1. What is a circular 1ueue? +ow it differs from linear 1ueue?
2. What are the limitations of circular array implementation of 1ueue?
3. Define input restricted 1ueue.
. Define output restricted 1ueue.
!. Define and List the types of De1ueue.
". List the applications of 0ueues.
PART B
1. Discuss the array representation of list with algorithm and example.
2. What is a singly lin,ed list? -how how insertion2 deletion and searching into a singly lin,ed
list could be carried out.
3. 3xplain and write the algorithms for creation2 insertion2 deletion2 searching and updation in
doubly lin,ed lists using pointers.
. 3xplain and write the algorithms for creation2 insertion2 deletion and searching in 4ircular
Lin,ed List.
!. &iven a list L12 delete all the nodes having even number in info part from the list L1 and
insert info list L2 and all the nodes having odd numbers into list L3. Write the algorithm.
". &iven two sorted lin,ed lists2 merge them into a third sorted lin,ed list2 if an element is
present in both the list2 it should occur only once in the third list. Write the algorithm.
$. Write )D* operations for array implementation of polynomial addition.
%. Write the algorithm to multiply two polynomials. Discuss with examples.
'. Discuss the concept of cursor and array implementation of L.-* with example.
1(. What is the stac, )D*? &ive any one array implementation of stac,. 3xplain the operations
used in the data structure.
11. 3xplain how the following 5infix6 expression is evaluated with the help of -tac, ! 7 8 " 9 2 :
; 12 < .
12. 3xplain the procedure and routines to evaluate the postfix expression using stac, with
example.
13. 3xplain the procedure to chec, the parentheses balancing in a given expression using stac,.
1. Discuss any two applications of stac, along with its implementations.
1!. +ow a 1ueue does wor,s? 3xplain the algorithm to insert and delete an element in a 1ueue.
1". Write )D* operations for circular 1ueue with suitable example.
1$. Describe the structure of a circular 1ueue and its advantages over linear 1ueues.
1%. Write insertion and deletion algorithm for various types of de1ueue.
UNIT II
PART - A
1. Define non#linear data structure.
2. Define tree.
3. List out few of the application of tree data structure.
. Define leaf.
!. What is level of node?
". Define degree of a node.
$. Define siblings.
%. Define level and height.
'. What is the length of the path in a tree?
1(. Define forest.
11. What is a ordered tree?
12. What is subtree?
13. Define =inary tree.
1. -tate the properties of binary tree.
1!. What are the applications of binary tree?
1". What is meant by traversing?
1$. What are the different types of traversals?
1%. What are the two methods of binary tree implementation?
1'. What are the various operation of binary trees that use lin,ed representation?
2(. Define pre#order traversal?
21. Define post#order traversal?
22. Define in #order traversal?
23. Define 4omplete =inary *ree?
2. What is *hreaded =inary *ree?
2!. -how that the maximum number of nodes in a binary tree of height h is 2
h91
#1.
2". Define expression trees?
2$. Define =inary -earch *ree?
2%. List out the steps involved in deleting a node from a binary search tree.
2'. List the applications of *rees.
3(. Define )>L *ree.
31. What is a balance factor in )>L trees?
32. What is meant by pivot node?
33. What are the different ways of balancing a tree?
3. What are the four different cases of pointer manipulations done in )>L rotation?
3!. Define =inary +eap
3". What is a complete binary tree?
3$. What is the structure property of a binary heap?
3%. What are the basic operations of binary heap?
3'. What is meant by percolate#down?
(. What is meant by percolate#up?
PART - B
1. Define binary search tree? 3xplain the various operations with an example?
2. 3xplain the recursive algorithm for tree traversals with examples.
3. 3xplain the non#recursive algorithm for tree traversals with examples.
. Discuss the constructing an expression tree with suitable example.
!. 4onstruct a binary tree to satisfy the following orders?
.norder? D = @ 3 ) & 4 L A + B
Costorder? D @ 3 = & L A B + 4 )
". 4onsider the following binary tree?
&
< D
D *
< < D
= E F
< D < D D
) 4 . B G
D
C
8a: What is the result of a postorder traversal of the above tree?
8b: What is the result of an inorder traversal of the above tree?
8c: .s the above tree a binary search tree? Why or why not?
$. Define a binary search tree 8=-*:.Write an algorithm to find2 insert and delete nodes from a
binary search tree.
%. Write down the algorithm binary search for searching x from an array aH12nI and give the
stepwise execution for an array 81(21222(22322$23(23123'222
2!2'2!$2"32$(: to search xJ.
'. 4onstruct a binary search tree for the following set of numbers and find the preorder2inorder
and postorder traversal of the tree K12%2112322232232!2'2112122
12"3221$L.
1(. Draw a binary search tree for the following input list K"(22!2$!21!2!(2""2332L. *race the
algorithm to delete the nodes K2!2$!2L from the tree.
11. Define )>L trees? 3xplain the LL2 MM2 ML2 LM cases with an example?
12. Write routines for )D* operation of )>L tree.
13. 3xplain with suitable examples the binary heap operations and algorithms for the same.
UNIT III
PART - A
1. What is hashing?
2. What is need for hashing?
3. Define hash function?
. Define hash table.
!. What is meant by preconditioning?
". 4lassify the hashing functions based on the various methods by which the ,ey value is
found.
$. &ive a simple hash function when the input ,eys are integers.
%. What is meant by collision?
'. &ive an example for collision.
1(. What are the problems in hashing?
11. What are the types of collision resolution techni1ues and the methods used in each of
the type?
12. What is open hashing or separate chaining?
13. What is closed hashing?
1. What is meant by load factor in hashing?
1!. What are the three strategies used in open addressing?
1". Define linear probing.
1$. Define 1uadratic probing.
1%. What is meant by primary clustering in linear probing techni1ue?
1'. What is the remedy for primary clustering problem?
2(. What are the drawbac,s in linear probing?
21. Define double hashing.
22. What is the need for rehashing?
23. When is the rehashing used?
2. List the condition in which rehashing is done.
2!. What is meant by extendible hashing?
2". What are the applications of hashing?
2$. Define e1uivalence relation and its properties.
2%. Define dynamic e1uivalence problem.
2'. What is e1uivalence class?
3(. What is meant by union#by#siNe approach?
31. What is meant by union#by#height approach?
32. 3xplain the path compression.
PART - B
1. What are the various hashing techni1ues? &ive suitable examples.
2. What is meant by collision resolution in hashing? 3xplain in detail any two strategy for
dealing with it.
3. Derive a scheme that performs insertions and deletions in a hash table.
. Write routines to find and insert an element in a separate chaining hash table.
!. +ow will you resolve the collisions2 while inserting elements into the hash table using
separate chaining and linear probing? Write the routines for inserting2 searching and
removing elements from the hash table using the above mentioned techni1ues.
". &iven input K3$12 13232 "1$32 1''2 32 '"$'2 1'%'L and a hash function h8F:JF 8mod
1(:2 show the resulting?
8a: -eparate chaining hash table
8b: Open addressing hash table using linear probing
8c: Open addressing hash table using 1uadratic probing
8d: Open addressing hash table with second hash function h
2
8F:J$#8F mod $:
$. 3xplain the concept of extendible hashing with neat example.
%. Discuss concept and algorithm for smart union algorithms with neat diagram.
'. What would you observe from the path compression?
UNIT IV
PART - A
1. Define the term &raph?
2. Define adPacent nodes.
3. List the two types of graphs.
. What is a directed and undirected graph?
!. What is a directed and undirected edge?
". What is a loop?
$. What is a simple graph?
%. What is a weighted graph?
'. What is an isolated node?
1(. What is a null graph?
11. 3xplain the following terms i: degree2 ii: indegree and iii: outdegree
12. Define total degree of a node.
13. Define path in a graph?
1. What is a simple path?
1!. What is a cycle or a circuit?
1". What is an acyclic graph and does an acyclic graph have loops2 why?
1$. What is a sin, node?
1%. What is meant by strongly connected in a graph?
1'. When is a graph said to be wea,ly connected?
2(. What is a complete graph?
21. /ame the different ways of representing a graph?
22. What is adPacency list and adPacency matrix?
23. What are the advantages of using lists for representing graphs?
2. What is topological sort?
2!. Where is topological sort used?
2". Does a directed graph with cycle has a topological order.
2$. Define weighted and unweighted path length.
2%. What are the two traversal strategies used in traversing a graph?
2'. What is a minimum spanning tree? /ame any two algorithms used to find E-*.
3(. Does the minimum spanning tree of a graph give the shortest distance
between any 2 specified nodes.
31. 4an we have a minimum spanning tree for a graph2 if & is not connected?
32. What is the number of edges in a minimum spanning tree?
33. &ive some applications of minimum spanning trees.
3. What is a single#source shortest path problem?
3!. What is meant by shortest path?
3". What is all#pairs shortest path problem?
3$. Write down the advantages of using all#pairs problem.
3%. &ive examples for shortest path problem.
3'. Define DiP,straQs greedy criterion.
(. What is the complexity of diP,straQs algorithm?
1. What is an undirected acyclic graph?
2. What is a spanning tree?
3. Define primQs algorithm.
. What is the running time for primQs algorithm?
!. Define D@-.
". Define biconnected graph.
$. Define a biconnected component.
%. What is articulation point?
'. What is connected component of a graph?
!(. Define 3uler path.
!1. Define 3uler circuit.
!2. Define a bipartite graph.
PART - B
1. 3xplain the various types of &raph representations.
2. 3xplain the various types of &raph traversals with neat algorithms.
3. 3xplain the concept of *opological -ort algorithm with example.
. 3xplain DiP,straRs algorithm finding shortest path in a networ, trace an algorithm for an
assumed networ,.
!. 3xplain DiP,straQs algorithm with an example. Does the algorithm wor, for paths of
negative values? 3xplain.
". Define spanning tree. 3xplain CrimRs algorithm to find a minimal spanning tree in a
connected graph with an example.
$. Describe and Pustify Brus,alQs algorithm for finding the minimum spanning tree of an
undirected graph.
%. Write )D* routines for depth first search algorithm.
'. What is D@-? 3xplain the applications of D@- in detail.
1(. Write a routine to find a shortest path between two given vertices in a weighted directed
graph. Sse it to find the shortest path between ) and @ in the following graph.
!
3
2 "
$ 3 !
11. Write a routine to find a minimum spanning tree of a weighted directed graph. Sse it to
find the E-* of the following graph.
!
3
2 "
$ 3 !
12. @ind the shortest path from ) to all other vertices for the graph in the following graph.
1
! 2 3 1
2 3 $
$ 2
2 1
$
UNIT - V
PART - A
1. Define algorithm.
B D
A
C E
F
B D
A
C E
F
B G
A
D E
F C
2. -tate properties of algorithms.
3. Define efficiency of an algorithm.
. What is an asymptotic notation? Eention its types.
!. Define time complexity of an algorithm.
". Define the asymptotic notation 5=ig on6 8(:.
$. Define the asymptotic notation 5Omega6 8 W :.
%. Define the asymptotic tDnotation 5theta6 81 :.
'. Define Little 5oh6.
1(. Define Little Omega.
11. Define worst case of an algorithm.
12. Define average case of an algorithm.
13. Define best case of an algorithm.
1. Eention the various spaces utiliNed by a program.
1!. Define space complexity of an algorithm.
1". -tate the different memory spaces occupied by an algorithm.
1$. Define instruction space of an algorithm.
1%. Define environment space of an algorithm.
1'. Define algorithmic paradigms space of an algorithm.
2(. 3xplain divide and con1uer techni1ue.
21. Eention some of the problem that implements divide and con1uer algorithm.
22. &ive the recurrence relation of divide#and#con1uer?
23. What is greedy algorithm?
2. Eention some of the problems that implements greedy algorithm.
2!. Define dynamic programming algorithm.
2". Eention some of the problems that implements dynamic programming algorithm.
2$. Define brute force algorithm.
2%. Eention some of the problems that implements brute force algorithm.
2'. Define bac,trac,ing algorithm.
3(. Eention some of the problems that implements bac,trac,ing algorithm2
31. Define longest common subse1uence problem.
32. Define ,napsac, problem.
33. Define % 1ueens problem.
3. Define traveling salesman problem.
3!. =riefly explain graph coloring.
3". What is /C completeness?
3$. What is the property of /C complete problem?
3%. List the example for /C complete problems.
3'. Define /C#hard.
(. What is meant by polynomial bounded?
1. When is a problem said to be polynomially bounded?
PART B
1. Discuss the fundamentals of analysis framewor, and notations used in algorithm design.
2. Discuss the various algorithm design strategies with examples.
3. Describe greedy method of solving problem. +ow can you apply it for optimal storage on
tapes?
. 3xplain the Bnapsac, problem in detail.
!. 3xplain the greedy strategy techni1ue in the design of algorithm.
". 3xplain divide and con1uer algorithm with example.
$. What is dynamic programming? Discuss the examples of dynamic programming.
%. 3xplain the any one concept of randomiNed algorithm.
'. Discuss the method of solving any problem by bac, trac,ing. +ow is it applicable to %
1ueens problem? 3xplain.
1(. 3xplain subset#sum problem and discuss the possible solution strategies using
bac,trac,ing.
11. Describe in detail the travelling salesman problem.
12. Discuss the solution for traveling salesman problem using branch and bound
techni1ue.
B! D"TAI#S
S$ No T%&e Title o' the Book Author Pu(lication
1. *ext =oo,
Data -tructures and
)lgorithm )nalysis in 4
E. ). Weiss
-econd 3dition2
Cearson 3ducation2
1''$
2. Meference =oo,
Crogramming with 499 D.Mavichandran
*ata Ec&raw +ill2
/ew Delhi
Data -tructures using 4
). E. *enenbaum
G. Langsam
E. A. )ugenstein
Cearson 3ducation2
1''%
Data -tructures
M. @. &ilberg
=. ). @orouNan
-econd 3dition2
*homson .ndia
3dition2 2((!
3. Bnowledge =oo, Data -tructure using 4 .-MD &roup
*ata Ec&raw +ill2
/ew Delhi
.
3xamination
=oo,
Data -tructures and
)lgorithm )nalysis in 4
E. ). Weiss
-econd 3dition2
Cearson 3ducation2
1''$
DATA STRU)TUR"S AND A#*RIT+,S
B$"$-B$Tech$ D"*R"" ".A,INATIN/ APRI#-,A0 1232
Third Semester
"lectrical and "lectronics "ngineering
""1124 5 DATA STRU)TUR"S AND A#*RIT+,S
Ans6er A## Questions
PART A 5 732 8 1 9 12 ,arks:
1. List out the areas in which data structures are applied extensively.
2. 4onvert the expression 88)9=:74#8D#3:T8@ 9&:: to e1uivalent Crefix and Cost fix
notations.
3. +ow many different trees are possible with 1( nodes?
. What is an almost complete binary tree?
". What is the buc,et siNe2 when the overlapping and collision occur at same time?
$. Define graph.
%. What is a minimum spanning tree?
'. Define /C hard and /C complete.
1(. What is meant by dynamic programming?
PART B 5 7; 8 3< 9 =2 ,arks:
11. 8a: 8i: What is a lin,ed list? 3xplain with suitable program segments any
four operations of a lin,ed list. 8Ear,s 12:
8ii: 3xplain with a pseudo code how a linear 1ueue could be converted
into a circular 1ueue. 8Ear,s :
Or
8b: 8i: What is a stac, )D*? Write in detail about any three applications of stac,.
8Ear,s 11:
8ii: With a pseudo code explain how a node can inserted at a user
specified position of a doubly lin,ed list. 8Ear,s !:
12. 8a: 8i: Discuss the various representations of a binary tree in memory with
suitable example. 8Ear,s %:
8ii: What are the basic operations that can be performed on a binary
tree? 3xplain each of them in detail with suitable example. 8Ear,s %:
Or
8b: 8i: &ive an algorithm to convert a general tree to binary tree. 8Ear,s %:
8ii: With an example2 explain the algorithms of in order and post order
traversals on a binary search tree. 8Ear,s %:
13. 8a: What is an )>L tree? 3xplain the rotations of an )>L tree. 8Ear,s 1":
Or
8b: 8i: 3xplain the binary heap in detail. 8Ear,s %:
8ii: What is hashing? 3xplain any two methods to overcome collision
problem of hashing. 8Ear,s %:
1. 8a: 8i: 3xplain DiP,straRs algorithm and solve the single source shortest
path problem with an example. 8Ear,s 12:
8ii: .llustrate with an example2 the lin,ed list representation of graph.8Ear,s :
Or
8b: 8i: Write the procedures to perform the =@- and D@- search of graph. 8Ear,s %:
8ii: 3xplain CrimRs algorithm to construct a minimum spanning tree
from an undirected graph. 8Ear,s %:
1!. 8a: 8i: With an example2 explain how will you measure the efficiency of an
algorithm. 8Ear,s %:
8ii: )nalyNe the linear search algorithm with an example. 8Ear,s %:
Or
8b: 3xplain how the travelling salesman problem can be solved using greedy algorithm.
8Ear,s 1":

Você também pode gostar