0% found this document useful (0 votes)
262 views

Question Bank: Subject: Data Structures and Algorithms

This document contains question banks for data structures and algorithms divided into 5 units: 1. Linear structures - Questions related to queues, stacks, linked lists, etc. 2. Tree structures - Questions related to binary trees, binary search trees, heaps, etc. 3. Hashing and sets - Questions related to hashing techniques like separate chaining and open addressing, and set operations. 4. Graphs - Questions related to graph representations, traversal techniques, shortest path problems, minimum spanning trees, etc. 5. Algorithm design and analysis - Questions related to algorithmic strategies, complexity analysis, design of algorithms to solve problems like matrix multiplication, Fibonacci series, etc.

Uploaded by

Saravana Priya
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views

Question Bank: Subject: Data Structures and Algorithms

This document contains question banks for data structures and algorithms divided into 5 units: 1. Linear structures - Questions related to queues, stacks, linked lists, etc. 2. Tree structures - Questions related to binary trees, binary search trees, heaps, etc. 3. Hashing and sets - Questions related to hashing techniques like separate chaining and open addressing, and set operations. 4. Graphs - Questions related to graph representations, traversal techniques, shortest path problems, minimum spanning trees, etc. 5. Algorithm design and analysis - Questions related to algorithmic strategies, complexity analysis, design of algorithms to solve problems like matrix multiplication, Fibonacci series, etc.

Uploaded by

Saravana Priya
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Subject: DATA STRUCTURES AND ALGORITHMS

Question Bank

UNIT I – LINEAR STRUCTURES(2 MARKS)

1. Define ADT.
2. Give the structure of Queue model.
3. What are the basic operations of Queue ADT?
4. What is Enqueue and Dequeue?
5. Give the applications of Queue.
6. What is the use of stack pointer?
7. What is an array?
8. Define ADT (Abstract Data Type).
9. Swap two adjacent elements by adjusting only the pointers (and not the
data) using singly linked list.
10. Define a queue model.
11. What are the advantages of doubly linked list over singly linked list?
12. Define a graph
13. What is a Queue?
14. What is a circularly linked list?
15. What is linear list?
16. How will you delete a node from a linked list?
17. What is linear pattern search?
18. What is recursive data structure?
19. What is doubly linked list?

PART- B (16 MARKS)

1. Explain the implementation of stack using Linked List.


2. Explain Prefix, Infix and postfix expressions with example.
3. Explain the operations and the implementation of list ADT.
4. Give a procedure to convert an infix expression a+b*c+(d*e+f)*g to
postfix notation
5. Design and implement an algorithm to search a linear ordered linked list
for a given
alphabetic key or name.
6. (a) What is a stack? Write down the procedure for implementing various
stack
operations(8)
(b) Explain the various application of stack? (8)
7. (a) Given two sorted lists L1 and L2 write a procedure to compute L1_L2
using only the basic operations (8)
(b) Write a routine to insert an element in a linked list (8)
8. What is a queue? Write an algorithm to implement queue with example.

UNIT II – TREE STRUCTURES(2 MARKS)

1. Explain Tree concept?


2. What is meant by traversal?
3. What is meant by depth first order?
4. What is In order traversal?
5. What is Pre order traversal?
6. What is Post order traversal?
7. Define Binary tree.
8. What is meant by BST?
9. Define AVL trees.
10. Give example for single rotation and double rotation.
11. Define Hashing.
12. Define Double Hashing.
13. What is meant by Binary Heap?
14. Mention some applications of Priority Queues.
15. Define complete binary tree.
16. How a binary tree is represented using an array? Give an example
17. A full node is a node with two children. Prove that the number of full
nodes plus one
is equal to the number of leaves in a non empty binary tree.
18. Define (i) inorder (ii) preorder (iii) postorder traversal of a binary tree.
19. Suppose that we replace the deletion function, which finds, return, and
removes the
minimum element in the priority queue, with find min, can both insert and
find min be
implemented in constant time?
20. What is an expression tree?
21. What is binary search tree?

PART B (16 MARKS)

1. Explain the operation and implementation of Binary Heap.


2. Explain the implementation of different Hashing techniques.
3. Give the prefix, infix and postfix expressions corresponding to the tree
given in figure.
4. (a) How do you insert an element in a binary search tree? (8)
(b) Show that for the perfect binary tree of height h containing2h+1-1 nodes,
the sum of
the heights of the nodes 2h+1 -1-1(h+1). (8)
5. Given input {4371,1323,6173,4199,4344,9679,1989} and a hash function
h(X)=X(mod10), show the resulting:
(a) Separate chaining table (4)
(b) Open addressing hash table using linear probing (4)
(c) Open addressing hash table using quadratic probing (4)
(d) Open addressing hash table with second hash function
h2(X) =7-(X mod 7). (4)
6. Explain in detail (i) Single rotation (ii) double rotation of an AVL tree.
7. Explain the efficient implementation of the priority queue ADT
8. Explain how to find a maximum element and minimum element in BST?
Explain detail
about Deletion in Binary Search Tree?
UNIT III- HASHING AND SETS
1. What is hashing?
2. What is Collision?
3. What is open addressing?
4. What is a hash function?
5. What is separate chaining?
6. What is linear probing?
7. Explain Hashing.
8. Show the result of inserting the keys 10111101, 00000010, 10011011, 10111110, 01111111,
01010001, 10010110, 00001011, 11001111, 10011110, 11011011, 00101011, 01100001,
11110000, 01101111 into an initially empty extendible hashing data structure with m = 4.
9. Describe in detail the basic operations on sets.
10. If A = {1, 2, 3} and B = {3, 4, 5}, what are the results of
a. UNION(A,B, C)
b. INTERSECTION(A, B, C)
c. DIFFERENCE(A, B, C)
d. MEMBER(1, A)
e. INSERT(1, A)
f. DELETE(1, A)
g. MIN(A)?

UNIT IV – GRAPHS

PART A (2 MARKS)

1. Define Graph.
2. What is meant by directed graph?
3. Give a diagrammatic representation of an adjacency list representation of
a graph.
4. What is meant by topological sort?
5. What is meant by acyclic graph?
6. What is meant by Shortest Path Algorithm?
7. What is meant by Single-Source Shortest path problem?
8. What is meant by Dijkstra’s Algorithm?
9. What is minimum spanning tree?
10. Mention the types of algorithm.
11. Define NP- complete problems
12. What is space requirement of an adjacency list representation of a graph
13. What is topological sort?
14. What is breadth-first search?
15. Define minimum spanning tree
16. Define undirected graph
17. What is depth-first spanning tree
18. What is Bi connectivity?
19. What is Euler Circuit?
20. What is a directed graph?
21. What is meant by ‘Hamiltonian Cycle’?
22. Define (i)indegree (ii)outdegree

PART - B (16 MARKS)

1. Explain Prim’s & Kruskal‘s Algorithm with am example.


2. Describe Dijkstra’s algorithm with an example.
3. Explain how to find shortest path using Dijkstra’s algorithm with an
example.
4. Explain the application of DFS.
5. Find a minimum spanning tree for the graph

using both Prim’s and Kruskal’s algorithms.


6. Explain in detail the simple topological sort pseudo code
7. Write notes on NP-complete problems

UNIT V – ALGORITHM DESIGN AND ANALYSIS


PART A (2 MARKS)
1. What is meant by algorithm? What are its measures?
2. Give any four algorithmic techniques.
3. Write an algorithm to find the factorial of a given number?
4. Define the worst case & average case complexities of an algorithm
5. What is divide & conquer strategy?
6. What is dynamic programming?
7. Write at least five qualities & capabilities of a good algorithm
8. Write an algorithm to exchange the values of two variables
9 Write an algorithm to find N factorial (written as n!) where n>=0.

PART B (16 MARKS)


1. (a) Explain in detail the types on analysis that can be performed on an
algorithm (8)
(b) Write an algorithm to perform matrix multiplication algorithm and
analyze the
same (8)
2. Design an algorithm to evaluate the function sin(x) as defined by the
infinite series
expansion sin(x) = x/1!-x3/3! +x5/5!-x7/7! +……
3. Write an algorithm to generate and print the first n terms of the Fibonacci
series where
n>=1 the first few terms are 0, 1, 1, 2, 3, 5, 8, 13.
4. Design an algorithm that accepts a positive integer and reverse the order
of its digits.
5. Explain the Base conversion algorithm to convert a decimal integer to its
corresponding octal representation.
6. Explain in detail about Greedy algorithm with an example(16).
7. Explain in detail about Divide and conquer algorithm with an example also
mark the difference between Greedy and divide and conquer algorithm.(16).
8. Describe the backtracking problem using knapsack problem .(16).

You might also like