SlideShare a Scribd company logo
1 of 20
CS8391
DATA
STRUCTURES
ANNA UNIVERSITY QUESTION BANK
PART B QUESTIONS
FROM
REGULATION 2008 &2013 QUESTION PAPERS
COMPILED BY:
DR. P. SUBATHRA. M.E., Ph.D.,
PROFESSOR IN INFORMATION TECHNOLOGY
KAMARAJ COLLEGE OF ENGINEERING AND TECHNOLOGY
MADURAI DISTRICT, NEAR VIRUDHUNAGAR, TAMIL NADU, INDIA
UNIT I - LINEAR DATA STRUCTURES
1
ARRAYS
1. Consider an array A[1:n]. Given a position, write an algorithm to insert an element in the array. If
the position is empty, the element is inserted easily. If the postion is already occupied the element
should be inserted with the minimum number of shifts. (Note: The elements can shift to the left or
to the right to make the minimum number of moves)
2. Describe the data structures used to represent lists. (16)
SINGLY LINKED LIST
3. Describe the data structures used to represent lists. (16)
4. Write a C code for singly linked list with insert, delete, display operations using structure pointer.
(16)
5. Illustrate the algorithms to create the singly linked list and perform all the operations on the
created list. (16)
6. Write algorithms to insert and delete elements from a linked list. Consider all cases. (16)
7. What is a singly linked list? Write a C program that uses functions to perform the following
operations on singly list with suitable diagrammatic representations. Consider all cases: (16)
a. Insertion b. Deletion c. Traversal in both ways
8. Write a program to print the elements of a singly linked list. (8)
9. Explain with an example the creation of a linked list, insertion and deletion of nodes and
swapping of any two nodes.
10. Develop a C program to split the linked list into two sub lists containing odd and even ordered
elements in them respectively. (16)
11. Write a C Program to add two polynomials using linked list. (16)
12. Write a program to add two polynomials using linked list. (16)
13. Develop the program in C to delete a node with the minimum value from a singly linked list. (16)
14. Formulate an algorithm to perform an insertion in a singly linked list in an increasing order of
their INFO field. (10)
15. Explain the following: (8+8)
b. Application of lists
c. Polynomial manipulation
16. Given two sorted lists L1 and L2, write a procedure to compute (10)
2
d. L1 intersection L2
e. L1 union L2 using only the basic list operations
17. Given two sorted linear linked lists L1 and L2, how do you create a list L3, which consisits of the
uncommon elements of L1 and L2? Write a suitable ADT for the construction of doubly linked
list L3. (8)
DOUBLY LINKED LIST
18. Illustrate the algorithm to implement the doubly linked list and perform all the operations on the
created list. (16)
19. Illustrate the necessary algorithms to implement doubly linked list and perform all the operations
on the created list. (16)
20. Describe the creation of a doubly linked list and appending the list. Give relevant coding in C.
21. Write an algorithm to perform insertion and deletion on a doubly linked list. (8)
22. Write a C program that uses functions to perform the following opearations on doubly linked list
f. Creation b. Insertion c. Deletion d. Traversal in both ways
23. Develop an algorithm to implement a Doubly Linked List. Give relevant example and
diagrammatic illustrations.
24. Write a procedure to insert a node, delete a node, count and display nodes in doubly linked list.
(16)
25. Write a program to store the polynomial expression terms in random order, display the terms in
descending order of powers and count the number of terms in the expression using doubly linked
list. (16)
CIRCULAR LINKED LIST
26. Write the program in C to transform a circular list into a chain. (8)
UNIT II - LINEAR DATA STRUCTURES – STACKS, QUEUES
3
STACK
1. Develop an algorithm to implement a Stack ADT. Give relevant example and diagrammatic
illustrations. (16)
2. Develop an algorithm to implement Stack ADT. Give relevant examples with diagrammatic
representations. (16)
3. Write and explain the ADT operations for array implementation of a Stack. (8)
4. Discuss about Stack ADT in detail. Explain any one application of stack. (16)
5. Develop algorithm for inserting and deleting values from a stack. (8)
6. Define C functions to evaluate a postfix expression using stack operation. (8)
7. Write a C program to convert an infix expression into a prefix expression (8)
8. Write a program to conver an infix expression to a postfix expression and evaluate that postfix
expression. (16)
9. Explain the process of postfix expression evaluation with an example. (8)
10. Explain the process of conversion from infix expression to postfix expression using stack. (6)
11. Write an algorithm to convert infix to postfix notation and prefix notation using stack. (16)
12. Explain the process of conversion from infix expression to postfix expression using stack. (6)
13. Explain the process of postfix expression evaluation with an example. (8)
14. Write an algorithm to convert the infix expression to postfix expression using stack. (8)
15. Write an algorithm to convert the infix expression to postfix expression. (10)
16. Write algorithm to convert infix to postfix notation and prefix notation using stack. (16)
17. Show the simulation using stack for the following expression to convert infix to postfix:
p * q + ( r – s/ t). (6)
18. Show the simulation using stack for converting the expression p * q+ ( r- s / t) from infix to
prefix. (6)
19. Write an algorithm to convert an infix expression to a postfix expression. Trace the algorithm to
convert the infix expression “(a+b)”c/d+e/f” to a postfix expression. Explain the need for infix
and postfix expressions. (16)
20. Simulate using Stack to convert the infix expression to postfix expression. (6)
A*(B+D)/E-F*(G+H/K)
21. Show the simulation using stack for the following expression: (6)
12+3*14 – (5*16) + 7
4
22. Simulate the conversion of infix to postfix expression using stack for the following expression: 3
– (4 / 2) + ( 1* 5 ) + 6. (8)
23. Trace the stack for the conversion of ((((A/B)-C)+(D+E))-(A*C)) from infix to postfix. (4)
QUEUE
1. Define Queue ADT. How is circular queue implemented? Give example.
2. Develop an algorithm to implement Queue ADT. Give relevant examples and diagrammatic
representations. (12)
3. Write and explain the ADT operations for array implementation of a Queue. (8)
4. Formulate an ADT to implement Queue using linked list. (8)
5. Explain about Queue ADT in detail. Explain any one application of queue with suitable example.
(16)
6. List the applications of Queues. (6)
7. Write an ADT for Enqueue and Dequeue. (6)
8. Develop algorithm for inserting and deleting values from a queue. (8)
CIRCULAR QUEUE
9. Write a C program to implement the circular queue using arrays. (8)
10. Write ADTs for insert and deleted operations in a Circular Queue using singly linked list. (8)
11. Describe circular queue implementation in detail giving all the relevant features. (16)
12. Differentiate between double ended queue and Circular queue. (4)
13. Write an algorithm to implement circular queue using arrays. (10)
14. Write an algorithm to perform the four operations in a double ended queue that is implemented as
an array. (16)
15. Write an algorithm to convert the infix expression to postfix expression. (10)
16. Write an algorithm to implement the circular queue using arrays. (10)
17. A circular queue has a size of 5 and has elements 10, 20 and 40 where F=2 and R=4. After
inserting 50 and 60, what is the value of F and R. Trying to insert 30 at this stage what happens?
Delete 2 elements from the queue and insert 70, 80 & 90. Show the sequence of steps with
necessary diagrams with the value of F and R. (6)
DEQUE (DOUBLE ENDED QUEUE)
18. Differentiate between double ended queue and Circular queue. (4)
5
19. Write a code to create generic data structure called dequeue which consists of a list of items. The
following operations are performed in deque: (12)
a. Push(x): insert item x on the front of the deque.
b. Pop(): Remove the front item from the deque and return it.
c. Inject(x): insert item s on the rear end of the deque
d. Eject(x): remove the rear item from the deque and return it.
Unit III
NON LINEAR DATA STRUCTURES – TREES
TREES
1. Define Tree. Explain the tree traversals with algorithms and examples. (16)
2. With suitable syntax, explain the tree traversals. (8)
6
3. Explain the tree traversals. Give all the essential aspects. (16)
4. Write an iterative algorithm to traverse a tree in preorder. (6)
BINARY TREES
5. Explain the array representation of a binary tree with suitable example. (8)
6. Construct a binary tree to satisfy the following orders:
Inorder : 2, 3, 4, 5, 6 7, 8, 9, 11, 12, 15, 19, 20
Postorder : 3, 2, 5, 6, 4, 8, 11, 9, 15, 20, 19, 12, 7
7. Write short notes on the applications of trees. (4)
8. Write a C program to delete all the leaf nodes of a binary tree. (8)
9. List the different types of Tree Traversal. Develop an algorithm for traversing a Binary Tree.
Validate the algorithm with a suitable example. (16)
10. Write in detail the various methods in which a binary tree can be represented. Discuss the
advantage and disadvantage of each method. (10)
11. Explain by an algorithm to create and delete a particular node from a binary tree. (8)
BINARY SEARCH TREES
12. Give the analysis of insertion and deletion operations of nodes in binary search tree. (16)
13. Explain binary search tree ADT in detail. (16)
14. Formulate an algorithm for performing insertion and deletion in a binary search tree. (10)
15. Write suitable ADTs to perform insertion and deletion operations in Binary Search Tree. (8)
16. Write a program to insert a node in a binary search tree. (8)
17. Make a BST for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69,
48. Traverse the tree in preorder, inorder and postorder. (6)
18. Simulate the result of inserting: 61, 32, 36, 14, 6, 75, 82, 3, 19, 87, 94 one at a time, into an
initially empty binary search tree. (4)
19. Simulate the deletion of the elements 36, 87, 61, 75 one by one from the above binary search tree.
(4)
20. Explain the operations of insertion of nodes into and deletion of nodes from a binary search tree
with code. (10)
21. Construct binary search tree to insert the following key elements. (10)
22, 44, 18, 35, 20, 12, 52, 19, 39 and delete 44 from it.
7
22. What is binary search tree? Write a C program to perform the following operations in a binary
search tree. i). Insert ii). Delete iii). Find Min iv). Find Max (16)
23. Write an algorithm to search for key elements from Binary Search Tree. (6)
24. Write generic code to insert into binary search tree (8)
25. Write an algorithm for binary search tree. Give example. (16)
26. Write generic code to insert into a binary search tree. (8)
27. Write the routine for the post order traversal. Give the preorder, postorder and inorder traversal
for the following tree. (8)
28. Write an ADT for Inorder, Preorder and Postorder traversals. Traverse the given tree using
Inorder, Preorder and Postorder Traversals. (12)
29. Write the function to perform insertion in a binary search tree. Show the result of inserting 4, 3, 8,
1, 9, 7, 10, 2, 5 into an empty binary search tree. (8)
EXPRESSION TREES
30. Explain expression tree with an example. (8)
31. Construct an expression tree for the expression (a+b*c) +((d*e+1)*g). give the output when you
apply preorder, inorder and postorder traversals. (6)
AVL TREES
32. Write the four AVL rotation functions only. (6)
8
33. Define AVL Trees. Explain its rotation operations with example.(16)
34. Define AVL tree and starting with an empty AVL search tree, insert the following elements in the
given order: 35, 45, 65, 75, 15, 25. (8)
35. Explain the AVL rotation with a suitable example. (8)
36. Explain the following routines in AVL tree with example. (16)
a. Insertion b. Deletion c. Single rotation d. Double rotation
37. Explain the AVL rotations with suitable example. (8)
38. Discuss how to insert an element in an AVL tree. (8)
39. Construct an AVL tree with the values 11, 5, 35, 8, 4, 2, 3, 77, 1 into an initially empty tree.
Write the code for inserting into an AVL tree. (10)
40. Assume the following keys form the Binary Search Tree (50, 30, 60, 40, 35, 80, 90). Analyze the
time complexity involved in searching the keys 90 and then 80, when the given BST is converted
into AVL or Splay tree. Identify the suitable tree data structure for representing this data and
justify your answer with valid reasons. (15)
41. Explain the possible AVL rotations with algorithm and example. (13)
42. Show the results of inserting 4, 1, 2, 5, 6, 7, 3 into an initially empty AVL tree. (8)
43. Define AVL tree and starting with an empty AVL search tree, insert the following elements in the
given order: 2, 1, 4, 5, 9, 3, 6, 7. (8)
44. Assume the following keys from the Binary Search Tree (50, 30, 60, 40, 35, 80, 90). Analyze the
time complexity involved in searching the keys 90 and 80, when the given BST is converted into
AVL or Splay tree. Identify the suitable tree data structure for representing this data and justify
your answer with valid reasons. (15)
45. Construct AVL tree for the following after rotation. (4+8+4)
9
THREADED BINARY TREES
46. Explain the Threaded Binary Tree with example. (8)
47. Explain about threaded binary tree in detail. (8)
48. Develop an algorithm to implement a Threaded Binary Tree. Validate the algorithm with a
suitable example. (16)
B TREES
49. Explain the operations which are done in B Tree with examples. (16)
50. Discuss in detail the B-tree. What are its advantages? (16)
51. Construct a B Tree with order m=3 for the key values 2, 3, 7, 9, 5, 6, 4, 8, 1 and delete the values
4 and 6. Show the tree in performing all operations. (6)
52. Draw B tree of order m=5 for the keys { K, O, S, V, M, F, B, G, T, U, W}. (6)
a. Delete the keys K and G in order. (4)
b. Justify the number of splits needed for insert/ delete with proper reasons. (3)
53. Insert into a B- Tree of order 5 with the following data: 8, 96, 116, 2, 7, 104, 110, 37, 86, 55, 46,
137, 145, 4, 5, 58, 6. (10)
54. Consider a B-Tree of order m=200. Calculate the number of keys searched in 4 passes. (6)
HEAPS
55. Compare min heaps and leftist trees. (4)
56. Explain binary heap that has a max-value at the root. (6)
10
57. Develop an algorithm to implement a Binary Heap. Validate the algorithm with a suitable
example. (16)
58. Explain binary heaps in detail. Give its merits. (16)
59. What is heap order property? Explain the operations which can be done in heap with examples.
(16)
60. Write the HeapSort algorithm. (8)
61. Show how heapsort processes the input 142, 543, 123, 65, 453, 879, 579, 434, 111, 242, 811, 102
(8)
62. Write a program that performs the following operations in a binary heap. (8)
a. Insert b. DeleteMin c. BuildHeap d. FindMin
63. Explain heap structures. How are binary heaps implemented? Give its algorithm with example.
(16)
64. Illustrate the construction of Binomial Heaps and its operations with a suitable example. (16)
65. Merge the given Binomial heaps. Write procedure for merge operation.
c. Delete three elements from the merged Binomial Queue. (5)
66. Explain insertion and deletion operations on Fibonacci heaps. Construct Fibonacci heaps for the
following set of elements 10, 11, 5, 35, 8, 4, 2, 3, 77, 1, 45. (13)
67. On an empty binomial heap, carry out the following sequence of operations: insert (27) insert(17)
insert(19) insert(20) insert(24) insert(12) insert(10) insert(14) insert(18), deletemin. After each
operation draw the resulting structure of the heap. (6)
68. Implement the Fibonacci heaps and compare their performance with binary heaps when used in
Dijkstra’s algorithm. (16)
UNIT IV
NON LINEAR DATA STRUCTURES – GRAPHS
GRAPH REPRESENTATION
11
24. Write the representation for the graph shown in Figure 1 as: (8)
a. Adjacency matrix b. Adjacency Lists c. Adjacency multilists
GRAPH TRAVERSAL
25. Write algorithm to compute the depth first search and apply the same to Figure 1. List the vertices
in the order they would be visited. (8)
26. Present the pseudocode of the different graph traversal methods and demonstrate with an
example. (13)
27. Given the BFS and DFS of the following Graph. (8)
28. Write the routines for post-order traversal. Give the preorder, postorder and inorder traversals for
the following tree. (8)
29. Write and trace the following algorithms with suitable example. (10)
a. Breadth-First Traversal
b. Depth-First Traversal
30. Apply depth first and breadth first search to the complete graph on four vertices. List the vertices
in the order they would be visited. (16)
31. Discuss any two applications of depth-first search. (8)
SPANNING TREE
12
32. Develop an algorithm to find the minimal spanning tree using Prim’s algorithm. Validate the
algorithm with a suitable example. (16)
33. Describe the Prim’s algorithm for minimum spanning tree. Give an example. (16)
34. Write a pseudo code for Prim’s algorithm. Also give an example to construct a minimum
spanning tree. (6)
35. Consider the following graph shown below and obtain the minimum spanning tree using prim’s
algorithm. (10)
36. Compute the minimum spanning tree for the following graph. (8)
37. Explain the Kruskal’s algorithm with an example. (10)
38. Consider the following graph. Obtain minimum spanning tree by Kruskal’s algorithm (10)
13
39. Determine the minimum spanning tree of a given Graph using Kruskal’s algorithm. Write
Kruskal’s MST algorithm. (10+3)
40. Find the minimum spanning tree for the given graph using both Prim’s and kruskal’s algorithm
and write the algorithms. (8 +8)
41. Explain about Prim’s and Kruskal’s algorithm in detail. (16)
42. Construct minimum spanning tree for the following graph using Prim’s and Kruskal’s algorithm.
(16)
43. Explain Prim’s and Kruskal’s algorithm. Find the minimum spanning tree for the following graph
using any one of the algorithms. (16)
14
TOPOLOGICAL SORT
44. Explain Topological sort with an example (6)
45. Write procedure to perform topological sort and explain. (16)
BICONNECTIVITY- CUT VERTEX
46. Define network flow problem. Explain the maximum flow algorithm for the graph given below.
(16)
EULER’S CIRCUIT
47. Explain Euler’s circuit with an example. (6)
48. Write a program to find an Euler circuit in a graph. Trace the algorithm with example. (6)
49. Give a short note on Euler circuits. (6).
50. Explain Euler Circuit with an example (6)
GRAPH SHORTEST PATH
51. Explain the Dijkstra’s algorithm for finding the shortest path with a sample graph. (16)
52. Consider the following graph. Determine the shortest distance to all other nodes using Dijkstra’s
algorithm. Write Procedure. (10+3)
53. Using Dijkstra’s algorithm find the shortest path from the source node A. (15)
15
54. For the given graph, find the shortest path from vertex 1 to all other vertices. (8)
55. Illustrate the Dijkstra’s algorithm for finding the shortest path with the following graph. (12)
56. Write the pseudo code for Dijkstra’s shortest path algorithm. Trace the algorithm for the
following graph. (8)
57. Find the shortest path from V1 to V7 using Dijkstra’s algorithm in the graph given below. (16)
16
58. Write the Pseudo code for Dijkstra’s shortest path algorithm. Give suitable example to trace the
algorithm. (10)
59. Develop an algorithm to compute the shortest path using Dijkstra’s algorithm. Validate the
algorithm with a suitable example. (16)
60. Explain greedy algorithm by solving the problem of single source shortest path of a digraph using
Dijkstra’s algorithm. (10)
61. Explain any one of the shortest path algorithms with suitable example.
62. Find the shortest path from ‘a’ to ‘d’ using Dijkstra’s algorithm in the graph in Figure 2. Given in
question (10)
UNIT V
SEARCHING, SORTING AND HASHING TECHNIQUES
SEARCHING
1. Write a C program to search a number with the given set of numbers using binary search. (8)
2. Explain the following:
17
a. Binary Searching (8)
b. Rehashing (8)
3. Write an algorithm to search a number in a given set of numbers using binary search. (8)
SORTING
4. Sort the given integers and show the intermediate results using selection sort. 45, 25, 10, 2, 9, 85,
102, 1 (8)
5. Write a C code to sort an integer array using selection sort (8)
6. Write the algorithm for Shell sort. (6)
7. Show how Heap sort processes the input 15, 75, 10, 80, 21, 35, 23, 8, 12, 7. (6)
8. Explain Heap sorting of data with suitable example. (10)
9. Explain shell sort algorithm with an example. (6)
10. Illustrate with an example the insertion sort algorithm to sort a list of elements in ascending order.
(6)
HASHING TECHNIQUES
11. Explain separate chaining and extendible hashing. (16)
12. With a procedure and a relevant example discuss separate chaining in hashing. (16)
13. Explain the open addressing and chaining methods of collision resolution techniques in hashing.
(16)
14. What is hashing? Explain open addressing and separate chaining methods of collision resolution
techniques with examples. (16)
15. Explain open addressing with its probing in detail.
16. Briefly explain the three common collision resolution strategies in open addressing hashing. (16)
17. Explain the collision resolving schemes in hashing with proper illustrations. (16)
18. What is collision in terms of hashing? Explain any thre collision resolution methods with
example. (8)
19. Illustrate with example the open addressing and chain method of collision resolution techniques
in hashing. (16)
20. Write short notes on hashing and the various collision resolution techniques. (8)
18
21. Illustrate collision resolution methods in hashing. (8)
22. Explain about different types of hash functions. (8)
23. Given Input (4371, 1323, 6173, 4111, 4299, 9669, 1989) and a hash function h(X) = X (mod 10)
show the result of: (16)
a. Separate chaining hash table.
b. Open addressing hash table using linear Probing
c. Open addressing hash table using Quadratic Probing
d. Open addressing hash table with second hash function h2(X)=7-(Xmod 7)
24. Explain the following:
a. Binary Searching (8)
b. Rehashing (8)
25. Write functions to insert/ retrieve an item into/from a hash table of size 31 using open addressing
and linear probing. Devise your own hash function and obtain the hash addresses for the keys 78,
101, 155, 289, 2345, 4000. Assume the following for the item. (16)
typedef struct item
{
Int key;
Double info;
}ITEM;
26. Show the extendable hash structure for the file if the hash function is h(x)=xmod 8 and bucket
can hold three records.
27. Formulate an algorithm to implement open addressing hash table with operations,
InitializeTable(), Insert(), Delete() and Find(). (10)
28. Consider inserting the key 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m=11 using
open addressing with the primary hash function h’(k)=k mod m. illustrate the result of inserting
these keys using linear probing, using quadratic and using double hashing with h2(k)=1+(k
mod(m-1)). (6)
29. Write a program to implement extendible hashing. If the table is small enough to fit in main
memory, how does its performance compare with open and closed hashing? (16)
30. Create extendible hash structure to insert the following key elements 2, 3, 5, 7, 11, 17, 19, 23,
29,31 (16)
19
20

More Related Content

What's hot

What's hot (20)

Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
stack & queue
stack & queuestack & queue
stack & queue
 
Introduction to data structures and Algorithm
Introduction to data structures and AlgorithmIntroduction to data structures and Algorithm
Introduction to data structures and Algorithm
 
Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm Arrays in Data Structure and Algorithm
Arrays in Data Structure and Algorithm
 
INTRODUCTION TO ALGORITHMS Third Edition
INTRODUCTION TO ALGORITHMS Third EditionINTRODUCTION TO ALGORITHMS Third Edition
INTRODUCTION TO ALGORITHMS Third Edition
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
The Stack And Recursion
The Stack And RecursionThe Stack And Recursion
The Stack And Recursion
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Circular queue
Circular queueCircular queue
Circular queue
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
sparse matrix in data structure
sparse matrix in data structuresparse matrix in data structure
sparse matrix in data structure
 
Priority queues
Priority queuesPriority queues
Priority queues
 
Linked list
Linked listLinked list
Linked list
 
Array ppt
Array pptArray ppt
Array ppt
 
Queue ppt
Queue pptQueue ppt
Queue ppt
 
convex hull
convex hullconvex hull
convex hull
 
Python set
Python setPython set
Python set
 
UNIT I LINEAR DATA STRUCTURES – LIST
UNIT I 	LINEAR DATA STRUCTURES – LIST 	UNIT I 	LINEAR DATA STRUCTURES – LIST
UNIT I LINEAR DATA STRUCTURES – LIST
 
A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)A Presentation About Array Manipulation(Insertion & Deletion in an array)
A Presentation About Array Manipulation(Insertion & Deletion in an array)
 

Similar to CS8391 Data Structures Part B Questions Anna University

Ds important questions
Ds important questionsDs important questions
Ds important questionsLavanyaJ28
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdfMemeMiner
 
Practical java
Practical javaPractical java
Practical javanirmit
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.organnaunivedu
 
Ds list of experiments ce
Ds list of experiments ceDs list of experiments ce
Ds list of experiments ceShraddha Patel
 
FDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.docFDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.docjaba kumar
 
Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002SANTOSH RATH
 

Similar to CS8391 Data Structures Part B Questions Anna University (20)

Ds important questions
Ds important questionsDs important questions
Ds important questions
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdf
 
Propulsion ii
Propulsion iiPropulsion ii
Propulsion ii
 
1. cs8451 daa anna univ question bank unit 1
1. cs8451 daa anna univ question bank unit 11. cs8451 daa anna univ question bank unit 1
1. cs8451 daa anna univ question bank unit 1
 
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
7th Semester (Dec-2015; Jan-2016) Computer Science and Information Science En...
 
Oops qb cse
Oops qb cseOops qb cse
Oops qb cse
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
Practical java
Practical javaPractical java
Practical java
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.org
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Paper
PaperPaper
Paper
 
Cs practical file
Cs practical fileCs practical file
Cs practical file
 
Qb ar college
Qb ar collegeQb ar college
Qb ar college
 
Ds list of experiments ce
Ds list of experiments ceDs list of experiments ce
Ds list of experiments ce
 
FDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.docFDS-CS8393 BME MODEL QP2.doc
FDS-CS8393 BME MODEL QP2.doc
 
Cs8251 faq1
Cs8251 faq1Cs8251 faq1
Cs8251 faq1
 
7th Semester Computer Science (2013-June) Question Papers
7th Semester Computer Science (2013-June) Question Papers7th Semester Computer Science (2013-June) Question Papers
7th Semester Computer Science (2013-June) Question Papers
 
7th cs june 2013
7th cs   june 20137th cs   june 2013
7th cs june 2013
 
2013-June: 7th Semester CSE Question Papers
2013-June: 7th  Semester CSE Question Papers2013-June: 7th  Semester CSE Question Papers
2013-June: 7th Semester CSE Question Papers
 
Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002Data structure using c bcse 3102 pcs 1002
Data structure using c bcse 3102 pcs 1002
 

More from P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai

More from P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai (20)

TestFile
TestFileTestFile
TestFile
 
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
3.1 Trees ( Introduction, Binary Trees & Binary Search Trees)
 
2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS2.1 STACK & QUEUE ADTS
2.1 STACK & QUEUE ADTS
 
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix2.2 stack applications Infix to Postfix & Evaluation of Post Fix
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
 
1. 6 doubly linked list
1. 6 doubly linked list1. 6 doubly linked list
1. 6 doubly linked list
 
1. 5 Circular singly linked list
1. 5 Circular singly linked list1. 5 Circular singly linked list
1. 5 Circular singly linked list
 
1. 4 Singly linked list deletion
1. 4 Singly linked list deletion1. 4 Singly linked list deletion
1. 4 Singly linked list deletion
 
1. 3 singly linked list insertion 2
1. 3 singly linked list   insertion 21. 3 singly linked list   insertion 2
1. 3 singly linked list insertion 2
 
1. 2 Singly Linked List
1. 2 Singly Linked List1. 2 Singly Linked List
1. 2 Singly Linked List
 
1. C Basics for Data Structures Bridge Course
1. C Basics for Data Structures   Bridge Course1. C Basics for Data Structures   Bridge Course
1. C Basics for Data Structures Bridge Course
 
Approximation Algorithms TSP
Approximation Algorithms   TSPApproximation Algorithms   TSP
Approximation Algorithms TSP
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
The stable marriage problem iterative improvement method
The stable marriage problem iterative improvement methodThe stable marriage problem iterative improvement method
The stable marriage problem iterative improvement method
 
Maximum matching in bipartite graphs iterative improvement method
Maximum matching in bipartite graphs   iterative improvement methodMaximum matching in bipartite graphs   iterative improvement method
Maximum matching in bipartite graphs iterative improvement method
 
Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)Knapsack dynamic programming formula top down (1)
Knapsack dynamic programming formula top down (1)
 
Knapsack dynamic programming formula bottom up
Knapsack dynamic programming formula bottom upKnapsack dynamic programming formula bottom up
Knapsack dynamic programming formula bottom up
 
Huffman tree coding greedy approach
Huffman tree coding  greedy approachHuffman tree coding  greedy approach
Huffman tree coding greedy approach
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Multiplication of integers & strassens matrix multiplication subi notes
Multiplication of integers & strassens matrix multiplication   subi notesMultiplication of integers & strassens matrix multiplication   subi notes
Multiplication of integers & strassens matrix multiplication subi notes
 

Recently uploaded

Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

CS8391 Data Structures Part B Questions Anna University

  • 1. CS8391 DATA STRUCTURES ANNA UNIVERSITY QUESTION BANK PART B QUESTIONS FROM REGULATION 2008 &2013 QUESTION PAPERS COMPILED BY: DR. P. SUBATHRA. M.E., Ph.D., PROFESSOR IN INFORMATION TECHNOLOGY KAMARAJ COLLEGE OF ENGINEERING AND TECHNOLOGY MADURAI DISTRICT, NEAR VIRUDHUNAGAR, TAMIL NADU, INDIA UNIT I - LINEAR DATA STRUCTURES 1
  • 2. ARRAYS 1. Consider an array A[1:n]. Given a position, write an algorithm to insert an element in the array. If the position is empty, the element is inserted easily. If the postion is already occupied the element should be inserted with the minimum number of shifts. (Note: The elements can shift to the left or to the right to make the minimum number of moves) 2. Describe the data structures used to represent lists. (16) SINGLY LINKED LIST 3. Describe the data structures used to represent lists. (16) 4. Write a C code for singly linked list with insert, delete, display operations using structure pointer. (16) 5. Illustrate the algorithms to create the singly linked list and perform all the operations on the created list. (16) 6. Write algorithms to insert and delete elements from a linked list. Consider all cases. (16) 7. What is a singly linked list? Write a C program that uses functions to perform the following operations on singly list with suitable diagrammatic representations. Consider all cases: (16) a. Insertion b. Deletion c. Traversal in both ways 8. Write a program to print the elements of a singly linked list. (8) 9. Explain with an example the creation of a linked list, insertion and deletion of nodes and swapping of any two nodes. 10. Develop a C program to split the linked list into two sub lists containing odd and even ordered elements in them respectively. (16) 11. Write a C Program to add two polynomials using linked list. (16) 12. Write a program to add two polynomials using linked list. (16) 13. Develop the program in C to delete a node with the minimum value from a singly linked list. (16) 14. Formulate an algorithm to perform an insertion in a singly linked list in an increasing order of their INFO field. (10) 15. Explain the following: (8+8) b. Application of lists c. Polynomial manipulation 16. Given two sorted lists L1 and L2, write a procedure to compute (10) 2
  • 3. d. L1 intersection L2 e. L1 union L2 using only the basic list operations 17. Given two sorted linear linked lists L1 and L2, how do you create a list L3, which consisits of the uncommon elements of L1 and L2? Write a suitable ADT for the construction of doubly linked list L3. (8) DOUBLY LINKED LIST 18. Illustrate the algorithm to implement the doubly linked list and perform all the operations on the created list. (16) 19. Illustrate the necessary algorithms to implement doubly linked list and perform all the operations on the created list. (16) 20. Describe the creation of a doubly linked list and appending the list. Give relevant coding in C. 21. Write an algorithm to perform insertion and deletion on a doubly linked list. (8) 22. Write a C program that uses functions to perform the following opearations on doubly linked list f. Creation b. Insertion c. Deletion d. Traversal in both ways 23. Develop an algorithm to implement a Doubly Linked List. Give relevant example and diagrammatic illustrations. 24. Write a procedure to insert a node, delete a node, count and display nodes in doubly linked list. (16) 25. Write a program to store the polynomial expression terms in random order, display the terms in descending order of powers and count the number of terms in the expression using doubly linked list. (16) CIRCULAR LINKED LIST 26. Write the program in C to transform a circular list into a chain. (8) UNIT II - LINEAR DATA STRUCTURES – STACKS, QUEUES 3
  • 4. STACK 1. Develop an algorithm to implement a Stack ADT. Give relevant example and diagrammatic illustrations. (16) 2. Develop an algorithm to implement Stack ADT. Give relevant examples with diagrammatic representations. (16) 3. Write and explain the ADT operations for array implementation of a Stack. (8) 4. Discuss about Stack ADT in detail. Explain any one application of stack. (16) 5. Develop algorithm for inserting and deleting values from a stack. (8) 6. Define C functions to evaluate a postfix expression using stack operation. (8) 7. Write a C program to convert an infix expression into a prefix expression (8) 8. Write a program to conver an infix expression to a postfix expression and evaluate that postfix expression. (16) 9. Explain the process of postfix expression evaluation with an example. (8) 10. Explain the process of conversion from infix expression to postfix expression using stack. (6) 11. Write an algorithm to convert infix to postfix notation and prefix notation using stack. (16) 12. Explain the process of conversion from infix expression to postfix expression using stack. (6) 13. Explain the process of postfix expression evaluation with an example. (8) 14. Write an algorithm to convert the infix expression to postfix expression using stack. (8) 15. Write an algorithm to convert the infix expression to postfix expression. (10) 16. Write algorithm to convert infix to postfix notation and prefix notation using stack. (16) 17. Show the simulation using stack for the following expression to convert infix to postfix: p * q + ( r – s/ t). (6) 18. Show the simulation using stack for converting the expression p * q+ ( r- s / t) from infix to prefix. (6) 19. Write an algorithm to convert an infix expression to a postfix expression. Trace the algorithm to convert the infix expression “(a+b)”c/d+e/f” to a postfix expression. Explain the need for infix and postfix expressions. (16) 20. Simulate using Stack to convert the infix expression to postfix expression. (6) A*(B+D)/E-F*(G+H/K) 21. Show the simulation using stack for the following expression: (6) 12+3*14 – (5*16) + 7 4
  • 5. 22. Simulate the conversion of infix to postfix expression using stack for the following expression: 3 – (4 / 2) + ( 1* 5 ) + 6. (8) 23. Trace the stack for the conversion of ((((A/B)-C)+(D+E))-(A*C)) from infix to postfix. (4) QUEUE 1. Define Queue ADT. How is circular queue implemented? Give example. 2. Develop an algorithm to implement Queue ADT. Give relevant examples and diagrammatic representations. (12) 3. Write and explain the ADT operations for array implementation of a Queue. (8) 4. Formulate an ADT to implement Queue using linked list. (8) 5. Explain about Queue ADT in detail. Explain any one application of queue with suitable example. (16) 6. List the applications of Queues. (6) 7. Write an ADT for Enqueue and Dequeue. (6) 8. Develop algorithm for inserting and deleting values from a queue. (8) CIRCULAR QUEUE 9. Write a C program to implement the circular queue using arrays. (8) 10. Write ADTs for insert and deleted operations in a Circular Queue using singly linked list. (8) 11. Describe circular queue implementation in detail giving all the relevant features. (16) 12. Differentiate between double ended queue and Circular queue. (4) 13. Write an algorithm to implement circular queue using arrays. (10) 14. Write an algorithm to perform the four operations in a double ended queue that is implemented as an array. (16) 15. Write an algorithm to convert the infix expression to postfix expression. (10) 16. Write an algorithm to implement the circular queue using arrays. (10) 17. A circular queue has a size of 5 and has elements 10, 20 and 40 where F=2 and R=4. After inserting 50 and 60, what is the value of F and R. Trying to insert 30 at this stage what happens? Delete 2 elements from the queue and insert 70, 80 & 90. Show the sequence of steps with necessary diagrams with the value of F and R. (6) DEQUE (DOUBLE ENDED QUEUE) 18. Differentiate between double ended queue and Circular queue. (4) 5
  • 6. 19. Write a code to create generic data structure called dequeue which consists of a list of items. The following operations are performed in deque: (12) a. Push(x): insert item x on the front of the deque. b. Pop(): Remove the front item from the deque and return it. c. Inject(x): insert item s on the rear end of the deque d. Eject(x): remove the rear item from the deque and return it. Unit III NON LINEAR DATA STRUCTURES – TREES TREES 1. Define Tree. Explain the tree traversals with algorithms and examples. (16) 2. With suitable syntax, explain the tree traversals. (8) 6
  • 7. 3. Explain the tree traversals. Give all the essential aspects. (16) 4. Write an iterative algorithm to traverse a tree in preorder. (6) BINARY TREES 5. Explain the array representation of a binary tree with suitable example. (8) 6. Construct a binary tree to satisfy the following orders: Inorder : 2, 3, 4, 5, 6 7, 8, 9, 11, 12, 15, 19, 20 Postorder : 3, 2, 5, 6, 4, 8, 11, 9, 15, 20, 19, 12, 7 7. Write short notes on the applications of trees. (4) 8. Write a C program to delete all the leaf nodes of a binary tree. (8) 9. List the different types of Tree Traversal. Develop an algorithm for traversing a Binary Tree. Validate the algorithm with a suitable example. (16) 10. Write in detail the various methods in which a binary tree can be represented. Discuss the advantage and disadvantage of each method. (10) 11. Explain by an algorithm to create and delete a particular node from a binary tree. (8) BINARY SEARCH TREES 12. Give the analysis of insertion and deletion operations of nodes in binary search tree. (16) 13. Explain binary search tree ADT in detail. (16) 14. Formulate an algorithm for performing insertion and deletion in a binary search tree. (10) 15. Write suitable ADTs to perform insertion and deletion operations in Binary Search Tree. (8) 16. Write a program to insert a node in a binary search tree. (8) 17. Make a BST for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48. Traverse the tree in preorder, inorder and postorder. (6) 18. Simulate the result of inserting: 61, 32, 36, 14, 6, 75, 82, 3, 19, 87, 94 one at a time, into an initially empty binary search tree. (4) 19. Simulate the deletion of the elements 36, 87, 61, 75 one by one from the above binary search tree. (4) 20. Explain the operations of insertion of nodes into and deletion of nodes from a binary search tree with code. (10) 21. Construct binary search tree to insert the following key elements. (10) 22, 44, 18, 35, 20, 12, 52, 19, 39 and delete 44 from it. 7
  • 8. 22. What is binary search tree? Write a C program to perform the following operations in a binary search tree. i). Insert ii). Delete iii). Find Min iv). Find Max (16) 23. Write an algorithm to search for key elements from Binary Search Tree. (6) 24. Write generic code to insert into binary search tree (8) 25. Write an algorithm for binary search tree. Give example. (16) 26. Write generic code to insert into a binary search tree. (8) 27. Write the routine for the post order traversal. Give the preorder, postorder and inorder traversal for the following tree. (8) 28. Write an ADT for Inorder, Preorder and Postorder traversals. Traverse the given tree using Inorder, Preorder and Postorder Traversals. (12) 29. Write the function to perform insertion in a binary search tree. Show the result of inserting 4, 3, 8, 1, 9, 7, 10, 2, 5 into an empty binary search tree. (8) EXPRESSION TREES 30. Explain expression tree with an example. (8) 31. Construct an expression tree for the expression (a+b*c) +((d*e+1)*g). give the output when you apply preorder, inorder and postorder traversals. (6) AVL TREES 32. Write the four AVL rotation functions only. (6) 8
  • 9. 33. Define AVL Trees. Explain its rotation operations with example.(16) 34. Define AVL tree and starting with an empty AVL search tree, insert the following elements in the given order: 35, 45, 65, 75, 15, 25. (8) 35. Explain the AVL rotation with a suitable example. (8) 36. Explain the following routines in AVL tree with example. (16) a. Insertion b. Deletion c. Single rotation d. Double rotation 37. Explain the AVL rotations with suitable example. (8) 38. Discuss how to insert an element in an AVL tree. (8) 39. Construct an AVL tree with the values 11, 5, 35, 8, 4, 2, 3, 77, 1 into an initially empty tree. Write the code for inserting into an AVL tree. (10) 40. Assume the following keys form the Binary Search Tree (50, 30, 60, 40, 35, 80, 90). Analyze the time complexity involved in searching the keys 90 and then 80, when the given BST is converted into AVL or Splay tree. Identify the suitable tree data structure for representing this data and justify your answer with valid reasons. (15) 41. Explain the possible AVL rotations with algorithm and example. (13) 42. Show the results of inserting 4, 1, 2, 5, 6, 7, 3 into an initially empty AVL tree. (8) 43. Define AVL tree and starting with an empty AVL search tree, insert the following elements in the given order: 2, 1, 4, 5, 9, 3, 6, 7. (8) 44. Assume the following keys from the Binary Search Tree (50, 30, 60, 40, 35, 80, 90). Analyze the time complexity involved in searching the keys 90 and 80, when the given BST is converted into AVL or Splay tree. Identify the suitable tree data structure for representing this data and justify your answer with valid reasons. (15) 45. Construct AVL tree for the following after rotation. (4+8+4) 9
  • 10. THREADED BINARY TREES 46. Explain the Threaded Binary Tree with example. (8) 47. Explain about threaded binary tree in detail. (8) 48. Develop an algorithm to implement a Threaded Binary Tree. Validate the algorithm with a suitable example. (16) B TREES 49. Explain the operations which are done in B Tree with examples. (16) 50. Discuss in detail the B-tree. What are its advantages? (16) 51. Construct a B Tree with order m=3 for the key values 2, 3, 7, 9, 5, 6, 4, 8, 1 and delete the values 4 and 6. Show the tree in performing all operations. (6) 52. Draw B tree of order m=5 for the keys { K, O, S, V, M, F, B, G, T, U, W}. (6) a. Delete the keys K and G in order. (4) b. Justify the number of splits needed for insert/ delete with proper reasons. (3) 53. Insert into a B- Tree of order 5 with the following data: 8, 96, 116, 2, 7, 104, 110, 37, 86, 55, 46, 137, 145, 4, 5, 58, 6. (10) 54. Consider a B-Tree of order m=200. Calculate the number of keys searched in 4 passes. (6) HEAPS 55. Compare min heaps and leftist trees. (4) 56. Explain binary heap that has a max-value at the root. (6) 10
  • 11. 57. Develop an algorithm to implement a Binary Heap. Validate the algorithm with a suitable example. (16) 58. Explain binary heaps in detail. Give its merits. (16) 59. What is heap order property? Explain the operations which can be done in heap with examples. (16) 60. Write the HeapSort algorithm. (8) 61. Show how heapsort processes the input 142, 543, 123, 65, 453, 879, 579, 434, 111, 242, 811, 102 (8) 62. Write a program that performs the following operations in a binary heap. (8) a. Insert b. DeleteMin c. BuildHeap d. FindMin 63. Explain heap structures. How are binary heaps implemented? Give its algorithm with example. (16) 64. Illustrate the construction of Binomial Heaps and its operations with a suitable example. (16) 65. Merge the given Binomial heaps. Write procedure for merge operation. c. Delete three elements from the merged Binomial Queue. (5) 66. Explain insertion and deletion operations on Fibonacci heaps. Construct Fibonacci heaps for the following set of elements 10, 11, 5, 35, 8, 4, 2, 3, 77, 1, 45. (13) 67. On an empty binomial heap, carry out the following sequence of operations: insert (27) insert(17) insert(19) insert(20) insert(24) insert(12) insert(10) insert(14) insert(18), deletemin. After each operation draw the resulting structure of the heap. (6) 68. Implement the Fibonacci heaps and compare their performance with binary heaps when used in Dijkstra’s algorithm. (16) UNIT IV NON LINEAR DATA STRUCTURES – GRAPHS GRAPH REPRESENTATION 11
  • 12. 24. Write the representation for the graph shown in Figure 1 as: (8) a. Adjacency matrix b. Adjacency Lists c. Adjacency multilists GRAPH TRAVERSAL 25. Write algorithm to compute the depth first search and apply the same to Figure 1. List the vertices in the order they would be visited. (8) 26. Present the pseudocode of the different graph traversal methods and demonstrate with an example. (13) 27. Given the BFS and DFS of the following Graph. (8) 28. Write the routines for post-order traversal. Give the preorder, postorder and inorder traversals for the following tree. (8) 29. Write and trace the following algorithms with suitable example. (10) a. Breadth-First Traversal b. Depth-First Traversal 30. Apply depth first and breadth first search to the complete graph on four vertices. List the vertices in the order they would be visited. (16) 31. Discuss any two applications of depth-first search. (8) SPANNING TREE 12
  • 13. 32. Develop an algorithm to find the minimal spanning tree using Prim’s algorithm. Validate the algorithm with a suitable example. (16) 33. Describe the Prim’s algorithm for minimum spanning tree. Give an example. (16) 34. Write a pseudo code for Prim’s algorithm. Also give an example to construct a minimum spanning tree. (6) 35. Consider the following graph shown below and obtain the minimum spanning tree using prim’s algorithm. (10) 36. Compute the minimum spanning tree for the following graph. (8) 37. Explain the Kruskal’s algorithm with an example. (10) 38. Consider the following graph. Obtain minimum spanning tree by Kruskal’s algorithm (10) 13
  • 14. 39. Determine the minimum spanning tree of a given Graph using Kruskal’s algorithm. Write Kruskal’s MST algorithm. (10+3) 40. Find the minimum spanning tree for the given graph using both Prim’s and kruskal’s algorithm and write the algorithms. (8 +8) 41. Explain about Prim’s and Kruskal’s algorithm in detail. (16) 42. Construct minimum spanning tree for the following graph using Prim’s and Kruskal’s algorithm. (16) 43. Explain Prim’s and Kruskal’s algorithm. Find the minimum spanning tree for the following graph using any one of the algorithms. (16) 14
  • 15. TOPOLOGICAL SORT 44. Explain Topological sort with an example (6) 45. Write procedure to perform topological sort and explain. (16) BICONNECTIVITY- CUT VERTEX 46. Define network flow problem. Explain the maximum flow algorithm for the graph given below. (16) EULER’S CIRCUIT 47. Explain Euler’s circuit with an example. (6) 48. Write a program to find an Euler circuit in a graph. Trace the algorithm with example. (6) 49. Give a short note on Euler circuits. (6). 50. Explain Euler Circuit with an example (6) GRAPH SHORTEST PATH 51. Explain the Dijkstra’s algorithm for finding the shortest path with a sample graph. (16) 52. Consider the following graph. Determine the shortest distance to all other nodes using Dijkstra’s algorithm. Write Procedure. (10+3) 53. Using Dijkstra’s algorithm find the shortest path from the source node A. (15) 15
  • 16. 54. For the given graph, find the shortest path from vertex 1 to all other vertices. (8) 55. Illustrate the Dijkstra’s algorithm for finding the shortest path with the following graph. (12) 56. Write the pseudo code for Dijkstra’s shortest path algorithm. Trace the algorithm for the following graph. (8) 57. Find the shortest path from V1 to V7 using Dijkstra’s algorithm in the graph given below. (16) 16
  • 17. 58. Write the Pseudo code for Dijkstra’s shortest path algorithm. Give suitable example to trace the algorithm. (10) 59. Develop an algorithm to compute the shortest path using Dijkstra’s algorithm. Validate the algorithm with a suitable example. (16) 60. Explain greedy algorithm by solving the problem of single source shortest path of a digraph using Dijkstra’s algorithm. (10) 61. Explain any one of the shortest path algorithms with suitable example. 62. Find the shortest path from ‘a’ to ‘d’ using Dijkstra’s algorithm in the graph in Figure 2. Given in question (10) UNIT V SEARCHING, SORTING AND HASHING TECHNIQUES SEARCHING 1. Write a C program to search a number with the given set of numbers using binary search. (8) 2. Explain the following: 17
  • 18. a. Binary Searching (8) b. Rehashing (8) 3. Write an algorithm to search a number in a given set of numbers using binary search. (8) SORTING 4. Sort the given integers and show the intermediate results using selection sort. 45, 25, 10, 2, 9, 85, 102, 1 (8) 5. Write a C code to sort an integer array using selection sort (8) 6. Write the algorithm for Shell sort. (6) 7. Show how Heap sort processes the input 15, 75, 10, 80, 21, 35, 23, 8, 12, 7. (6) 8. Explain Heap sorting of data with suitable example. (10) 9. Explain shell sort algorithm with an example. (6) 10. Illustrate with an example the insertion sort algorithm to sort a list of elements in ascending order. (6) HASHING TECHNIQUES 11. Explain separate chaining and extendible hashing. (16) 12. With a procedure and a relevant example discuss separate chaining in hashing. (16) 13. Explain the open addressing and chaining methods of collision resolution techniques in hashing. (16) 14. What is hashing? Explain open addressing and separate chaining methods of collision resolution techniques with examples. (16) 15. Explain open addressing with its probing in detail. 16. Briefly explain the three common collision resolution strategies in open addressing hashing. (16) 17. Explain the collision resolving schemes in hashing with proper illustrations. (16) 18. What is collision in terms of hashing? Explain any thre collision resolution methods with example. (8) 19. Illustrate with example the open addressing and chain method of collision resolution techniques in hashing. (16) 20. Write short notes on hashing and the various collision resolution techniques. (8) 18
  • 19. 21. Illustrate collision resolution methods in hashing. (8) 22. Explain about different types of hash functions. (8) 23. Given Input (4371, 1323, 6173, 4111, 4299, 9669, 1989) and a hash function h(X) = X (mod 10) show the result of: (16) a. Separate chaining hash table. b. Open addressing hash table using linear Probing c. Open addressing hash table using Quadratic Probing d. Open addressing hash table with second hash function h2(X)=7-(Xmod 7) 24. Explain the following: a. Binary Searching (8) b. Rehashing (8) 25. Write functions to insert/ retrieve an item into/from a hash table of size 31 using open addressing and linear probing. Devise your own hash function and obtain the hash addresses for the keys 78, 101, 155, 289, 2345, 4000. Assume the following for the item. (16) typedef struct item { Int key; Double info; }ITEM; 26. Show the extendable hash structure for the file if the hash function is h(x)=xmod 8 and bucket can hold three records. 27. Formulate an algorithm to implement open addressing hash table with operations, InitializeTable(), Insert(), Delete() and Find(). (10) 28. Consider inserting the key 10, 22, 31, 4, 15, 28, 17, 88, 59 into a hash table of length m=11 using open addressing with the primary hash function h’(k)=k mod m. illustrate the result of inserting these keys using linear probing, using quadratic and using double hashing with h2(k)=1+(k mod(m-1)). (6) 29. Write a program to implement extendible hashing. If the table is small enough to fit in main memory, how does its performance compare with open and closed hashing? (16) 30. Create extendible hash structure to insert the following key elements 2, 3, 5, 7, 11, 17, 19, 23, 29,31 (16) 19
  • 20. 20