0% found this document useful (0 votes)
5 views12 pages

DSA QB 2024 New

The document is a question bank for the subject 'Data Structures and Algorithms' for a Computer Science and Engineering course. It covers various topics including Abstract Data Types, Linear Structures, and Sorting and Searching algorithms, with questions categorized into Part A and Part B. The questions range from definitions and explanations of concepts to practical programming tasks and algorithm analysis.

Uploaded by

sakthivelkasipkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

DSA QB 2024 New

The document is a question bank for the subject 'Data Structures and Algorithms' for a Computer Science and Engineering course. It covers various topics including Abstract Data Types, Linear Structures, and Sorting and Searching algorithms, with questions categorized into Part A and Part B. The questions range from definitions and explanations of concepts to practical programming tasks and algorithm analysis.

Uploaded by

sakthivelkasipkm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

Subject Code With CD3291 - DATA STRUCTURES Facult Mr. K.MANIRAJ


Name AND ALGORITHMS y
Year/Class/Sem II / IT / III
UNIT – 1 – ABSTRACT DATA TYPE
Abstract Data Types (ADTs) – ADTs and classes – introduction to OOP – classes in Python –
inheritance – namespaces – shallow and deep copying Introduction to analysis of algorithms –
asymptotic notations – divide & conquer – recursion – analyzing recursive algorithms
PART A
1. State the uses of abstract data type?( APRIL-MAY 23)
What are abstract data types. Give example (NOV-DEC 22)(R-17)
2. What is abstract data type? What are all not concerned in an ADT? (DEC 19)
Define abstract data type. (NOV/DEC 2023)
3. Define data structure and how the data types are classified at the higher level. (NOV DEC 2023)
4. Define polymorphism.
5. What is init method? Give example.
6. Write down the features of OOP.
7. Define inheritance?
8. Name the terminologies used in object oriented programming?
9. Write the advantages and disadvantages of OOP.
10. Differentiate object oriented and procedural programming approach?
11. What is namespaces? How we can resolve the name clash using namespace?
12. Difference between class and object(instances)
13. Differentiate shallow and deep copying?
14. Define time and space complexity?
15. What is an Algorithm? How to compute its time complexity?
16. What are the drawbacks in using the standard unit of time, to measure the runtime of an
algorithm?
17. Write the concept of time and space complexity.
How do you measure the efficiency of an algorithm.(may 19)(DEC 12)
18. How to measure an algorithm’s running time? DEC 17
What is an algorithm? How to compute its time complexity? (APR/MAY 2023)
19. What is meant by divide and conquer technique?
Give the general strategy of divide and conquer method. MAY 13/MAY 16,MAY-17
20. Establish the relation between O and Ω.(DEC 10)
21. Define Big oh notation. (MAY12)
22. Define Big omega notation (MAY 13)
23. Define big theta notation. DEC 14
24. The (log n)th smallest number of n unsorted numbers can be determined in O(n) average, case
time (True/False) DEC 15
25. Compare the orders of growth of n(n-1)/2 and n2. MAY 16
26. What is recursion in data structure? (NOV DEC 2023)
27. What do you mean by “worst case-efficiency” of an algorithm? Dec 17
28. Differentiate time complexity from space complexity.(MAY10)
PART-B
1. i. Explain namespaces and its types. How we can resolve the name clash using
namespace? NOV/DEC 2023
ii. Explain the ADT Operations and ADT Data Structures. APR/MAY2023
2. List the advantages and disadvantages of OOP. APR/MAY2023
Differentiate procedural and object oriented programming approach.
3. Describe about inheritance and types of inheritance with real time example
4. Show the following equations are correct. MAY-13
i.
ii. )
iii. )
2 2
iv. 5n -6n=Ɵ(n )
5. Demonstrate in detail about classes in python APR/MAY2023
Explain in short about python classes and objects. NOV/DEC 2023
6. What is OOP? Write down the features of Object Oriented Programming APR/MAY2023
7. Describe the following (i). inheritance (ii). Shallow and deep copying NOV/DEC 2023,
(APR/MAY 23) (R-21)
8. i. Write a python program using the str method for Point class. Create a Point object and print
it.
ii. Is it possible to use constructors in Python? if yes, explain it with suitable example.
9. Define time and space complexity. Compute time and space complexity with example. Give best
case, worst case and average case time complexity.
10. Categorize all the asymptotic notations with example. Give the basic asymptotic efficiency
classes. NOV/DEC 2023 (OR)
Explain briefly Big oh Notation, Omega Notation and Theta Notation. Depict the same
graphically and explain. MAY 18
11. (i)state whether following equalit y is correct or wrong? MAY 15
10 n 3 +n log n +9=O(n 2 )
(ii) derive a loose bound on the following equat ion:
f(x) =35x 8 -22x 7 +14x 5 -2x 4 -4x 2 +x-15
12. Derive the recurrence relation for Fibonacci series algorithm: also carry out the time complexity
algorithm. MAY 14.
13. Apply the steps in Mathematical analysis for recursive algorithms. Do the same for finding the
factorial of a number. (APR/MAY 23) (R-21)
14. Explain the Tower of Hanoi problem and solve it using recursion. MAY 13,14
Give the general plan for analysing the time efficiency of recursive algorithms and use recurrence
to find number of moves for tower of honoi problems. MAY 18
UNIT – 2 – LINEAR STRUCTURES
List ADT – array-based implementations – linked list implementations – singly linked lists – circularly linked
lists – doubly linked lists – Stack ADT – Queue ADT – double ended queues – applications

PART A
1. List the advantage of doubly linked list. (APRIL-MAY 23)
2. How a circular linked list is advantageous over a linear list. (NOV-DEC 22) (R-17)
3. Outline the linear and non-linear data structure with example(NOV-DEC 22) (R-21)
4. Outline the circular linked list with diagram(NOV-DEC 22) (R-21)
5. i. When array is better than linked list? Give an example(NOV-DEC 22) (R-21) (R-17)
ii. What are the advantages of linked list over array(APRIL/MAY 19)
6. i. What are the benefits of circularly linked list over singly linked list in search application.
(NOV-DEC 22) (R-17)
7. Write down the applications of list(NOV/DEC 20)
8. List the difference between linear linked list and circular linked list(APRIL/MAY 19)
9. What is stack adt? List its operations. APR/MAY 2023
10. Define linked list(NOV/DEC 19)
11. What are the two ways used to implement list? List down the various operations performed on
static linked list?
12. Write the underflow and overflow conditions in stack( APRIL-MAY 23)
13. Should array of linked list be used for the following type of applications. Justify your answer.
MAY 14
a. Many search operations in sorted list.
b. Many search operations in unsorted list.
14. What is static linked list? State any two applications of it. MAY 15
15. What is a queue data structure (NOV-DEC 22) (R-21)
16. Give the limitations of linear Queue( APRIL-MAY 23)
17. Define pop operations along with its necessary condition. (NOV-DEC 22) (R-17)
18. Convert the infix expression (a+b)*(c-d) and a*b/c+d into postfix expression (NOV-DEC 22)
(R-21)
19. Write the applications of stack. DEC 14,18,19
20. Given the prefix for an expression write its postfix. -*-+abc/ef-g/hi MAY 15
21. State the rules to be followed during infix to postfix conversion. DEC 19
22. Write any four applications of queue MAY 14
23. What is DEqueue(Double Ended Queue) May 14,16
24. What do the terms LIFO and FIFO means? Explain.
25. What are the front and rear pointers of queue.
26. What is the use of queue in operating system?
27. How double ended queue is different from circular queue? APR/MAY2023
28. Write the routine for Enqueue and Dequeue operation.
PART-B
1. i. Explain how list operations can be implemented using arrays. . ( APRIL-MAY 23)
ii. Write python program to merge two sorted arrays ( APRIL-MAY 23)
2. Describe the various operations and implementation of the list ADT with example. (APR/MAY 22)
(OR)
Explain the list ADT with example (NOV DEC 2023)
(OR)
Explain various implementation techniques used in implementation of list.
i. Array based implementation
ii. Linked list based implementation
3. a. Write the procedure or pseudocode for the following operation on circular linked list
(DEC 21)
i. Insertion
ii. Deletion
iii. Count
b. Distinguish circular linked list and doubly linked list during insertion and deletion operation.
(NOV/DEC 2023)
4. Explain how polynominal expression can be represented using linked list. ( APRIL-MAY 23) OR
State the polynomial representation for 6x3 +9 x2 +7 x +1 using linked list. Write the procedure to add and
multiply two polynomial and explain with suitable example. (DEC 18)
(OR)
Implement polynomial addition using linear linked list . Have functions for sorting, traversing
and adding any two polynomial expressions. (NOV-DEC 22) (R-17)
(OR)
Explain how polynominal expression can be represented using linked list.outline the addition of two
polynomials using linked list with an example. (NOV-DEC 22), (NOV/DEC 2023)
5. Explain the steps involved in the following insertion operation in a singly linked list, (APR/MAY 22)
i. Insert the node in the start and end
ii. Insert the node in the middle of the list
OR
Write the program to derive an ADT to perform insertion and deletion in singly linked list. (
APRIL-MAY 23)
6. Write an algorithm to perform following operations in doubly linked list.
Insert a node at the end of the list.
Delete the last node in the list. (DEC 20)
OR
Write a program to traverse a doubly linked list using only one space for address field with every node.
7. Write an algorithm for push and pop operations on stack using linked list.( APRIL-MAY 23) OR
What is stack ADT and what are the various operations on Stack? Write the python program to perform
its operation. (NOV DEC 20233)
OR
Write the python program to implement the stack ADT using linked list. ( APRIL-MAY 23)
OR
Outline the algorithm (pseudocode) for performing the following operation in stack using array
implementation (NOV/DEC 2023)
1. Create 2. Push
3. Pop 4. Stack top
8. Write the procedure to convert the infix to postfix expression and the steps involved in evaluating the
postfix expression. Covert the expression A – ( B/C + (D%E*F)/G)*H to postfix form. Evaulate the
given postfix expression 9 3 4 * 8 + 4 / -.(DEC 19)
(OR)
Convert the given postfix expression ABC*+D/E-FQ* inti a prefix and infix expressions and explain the
procedure in detail. Illustrate the steps. (NOV-DEC 23) (R-21)
9. Find the value of the following postfix expression. Show stack content by step by step output.
54 6 + 7 4 - * 9 / 35 15 + + (DEC 20)
(OR)
Outline the algorithm for evaluating the postfix expression using stack data structure with an
example. (NOV-DEC 22) (R-21)
(OR)
Convert the following infix to postfix expressions (4+8)*(6-5)/((3-2)*(2+2) (DEC 20)
10. Discuss any two applications of stack with relevant example. (DEC 15)
OR
Identify how stack are used for checking whether an expression is balanced or not for every right
and left brace, bracket and parenthesis. (NOV/DEC 2023)
11. What is linked stack? Discuss the operations of linked stack with relevant example. (DEC 15)
(OR)
Write an algorithm for push and pop operation on stack using linked list. DEC 19
12. Write a python program to reverse the string.
13. What is linked queue ADT and what are the various operations on linked queue? (NOV DEC
2023)
14. What is queue ADT and what are the various operations on queue? (NOV DEC 2023)
(Or)
Implement queue operation using python.
OR
State the procedure for performing enqueue, dequeue, isempty, and isfull operartions in a queue
data structure with example data. (NOV/DEC 2023)
15. i. What is a Deque(double ended queue)? Outline the operations that can be performed on a
deque with an algorithm, example and relevant diagram.(NOV-DEC 22) (R-21)
ii. Recognize the differences between circular queue and dequeue. (NOV/DEC 2023)

UNIT – 3 SORTING AND SEARCHING


Bubble sort – selection sort – insertion sort – merge sort – quick sort – analysis of sorting algorithms – linear
search – binary search – hashing – hash functions – collision handling – load factors, rehashing, and efficiency

PART A
1. What is the recurrence for worst case of Quick sort and what is the time complexity in the Worst
case? .(NOV-DEC 23)
2. What is sorting in data structure and explain why in-place sorting is better?(APR/MAY 2023)
3. Differentiate between internal and external sorting(DEC 14, 19), (NOV/DEC 2023)
4. What is time complexity of binary search(MAY 19)
5. Compare linear search and binary search(MAY 19)
6. Write the procedure for bubble sort algorithm.(NOV-DEC 22)
7. Name the applications of linear and binary search techniques. (APR/MAY 22)
8. Compare linear search and binary search(MAY 19)
9. Identify the principle behind the external sorting algorithm( APRIL-MAY 23)
10. What are the steps involved in performing selection sort(DEC 20)
11. Outline the devide and conquer design paradigm(NOV-DEC 22) (R-21)
12. What is the reason for collision in hashing techniques(dec 21)
13. What is Hashing? What is it's importance in data structures? (APR/MAY 2023)
14. List the different method to perform hashing.
15. What are the advantages and disadvantages of separate chaining and linear probing(DEC 18)
16. What is Re-Hashing(DEC 15)
17. What is the load factor in data structure. .(NOV-DEC 23)
18. List the limitations of linear probing(DEC 20)
19. When do rehashing of a hash table be required(NOV-DEC 22)
20. Outline perfect minimal hashing function( APRIL-MAY 23)
21. What is quadratic probing?
22. What is collision in hash table?
23. List the types of open addressing
24. What are the advantages and disadvantages of separate chaining and linear probing? (DEC
2018)
25. What do you mean by collision resolution by chaining?
26. Write down the applications of hashing.
27. Define double hashing.
28. What is clustering in hash table? How it is resolved?
PART-B
1. Suppose we are sorting an array A[2 5 1 7 9 12 11 10] using bubble sort. Give all the steps while
sorting the array. What is the best and worst case time complexity of bubble sort. (NOV-DEC
23)
(OR)
Write an algorithm to implement bubble sort with suitable examples. ( APRIL-MAY 23)
(OR)
Derive the time complexity of bubble sort (APR/MAY 2023)
2. Suppose we are sorting an array A[5 4 1 10 18 15 11] using insertion sort. Give all the steps
while sorting the array. Calculate its best time and worst time complexity based on the given
example. (NOV-DEC 23)
OR
Indicate the function for insertion sort with an example. (NOV/DEC 2023)
(OR)
Outline the steps in the insertion sort algorithm and apply the algorthim for the numbers given below 12,
06, 14,02,01,04,03. (DEC22)
3. Write the algorithm to sort of ‘N’ numbers using quick sort. Demonstrate the algorithm for the following
set of numbers: 88,11,22,44,66,99,32,67,54,10. (APR/MAY 22)
(OR)
Derive the time complexity of quick sort. (NOV-DEC 23)
4. Trace the working of selection sort algorithm on an unordered data set of size 10(NOV-DEC 22)
5. Illustrate the binary search algorithm with a suitable example.(NOV-DEC 22)
Define how binary search logic is better than linear search with an algorithm and an example.
(NOV/DEC 2023)
6. Compare the quick sort with merge sort and write an algorithm to implement merge sort
(NOV/DEC 2023)
7. Write the function to perform merge sort. Give example. (MAY 2019), (NOV/DEC 2023)
(OR)
Sort the following numbers using merge sort algorithm 11, 8, 55, 22, 33, 27, 62, 35, 71.
Obtain the worst case and average case time complexity. (DEC 15,2018)
8. Write the python program to perform linear search. Give example. (MAY 2019)
9. Define hash function. How will you calculate the hash function using division(various methods).
(NOV-DEC 23)
10. Discuss the common collision resolution strategies used in closed hashing system. ( APRIL-MAY 23)
11. Given input {4371, 1323, 6173, 4199,4144,9679,1989} and a hash function h(x)=x(mod 10).
Show the resulting. (APR/MAY 22)
i. Open hash table
ii. Closed hash table using linear probing
iii. Closed hash
12. Explain the following collision resolution strategies with example.(Dec 15)
i. Separate chaining
ii. Linear probing
iii. Quadratic probing
13. Illustrate with example the open addressing and chaining method of collision resolution techniques in
hashing. (MAY 17)
14. When do you perform rehashing? Illustrate with example (MAY -19)
15. The keys 12,18,13,2,3,23,5 and 15 are inserted into an initially empty hash table of length 10 using linear
probing with hash function h(k)=k mod 10. What is the resultant hash table. . (APRIL-MAY 23)
OR
Discuss about linear probing collision resolution technique with an example. (NOV/DEC 2023)

UNIT – 4 TREE STRUCTURES


Tree ADT – Binary Tree ADT – tree traversals – binary search trees – AVL trees – heaps – multiway search
trees

PART A
1. Define tree traversal and what is the time complexity of level order traversal? ( APR/MAY 2023)
2. Define binary tree and give binary tree node structure. (DEC 12)
3. What is the difference between tree depth and height? (NOV/DEC 2023)
4. How is binary tree is represented using array. Give an example.(DEC 05)
5. State the properties of binary search tree and binary tree( APRIL-MAY 23)
6. What is mean by equivalent binary tree? (MAY 11)
7. What are the ways in which the general trees are traversed. (NOV-DEC 22)
8. Construct the binary tree for the following expression (a+b)*(c-d). (NOV-DEC 22) (R-21)
9. Write an algorithm to declare nodes of an tree structure . (MAY 10)
10. List the operations defined on binary trees data type with a suitable example. (MAY 09)
11. Define binary search tree. (DEC 19)
12. Which tree representation is mostly preferred by the developers- Sequential or linked.? Justify.
13. Why it is said that the searching node in binary search tree is efficient than the simple binary
tree?
14. How to resolve null links in a binary tree? (MAY 19).
15. The depth of the complete binary tree is 8. And compute the no of nodes in leafs. (MAY 19)
16. Show the results of inorder traversal of the binary search tree with example. (DEC 18)
17. What is AVL tree ?
18. Define Heap in Data Structures. ( APR/MAY 2023)
19. Define Heap in Data Structures. What are the properties of a heap? (NOV/DEC 2023)
20. Mention the types of rotations performed on AVL tree( APRIL-MAY 23)
21. What is a heap? Outline the properties of heap(NOV-DEC 22) (R-21)
22. How do we calculate the balance factor for each node in an AVL tree? (APR/MAY 22)
23. Give the structure of a node in a B+ Tree.(NOV /DEC 21)
Define B+ tree with an example. (NOV/DEC 2023)
24. List the application of trees. (DEC 11)
25. Mention some problems for which heaps are more applicable. .(NOV /DEC 21)
26. Distinguish binary search tree and AVL tree. (NOV/DEC 2023)
27. Outline the difference between B-Tree and B+ Tree data structure with respect to storing—keys
and records.(NOV-DEC 22) (R-21)
28. What are the properties of binomial heaps?
PART-B
1. Write the following routines to implement the basic binary search tree operations
i. Perform search operation in binary search tree
ii. Find_min and Find_max
2. Explain tree traversal technique with a suitable example and tame complexity. ( APR/MAY
2023), (NOV/DEC 2023)
Outline the inorder, preorder and postorder traversal on a binary tree an algorithm and an
example.(NOV-DEC 22) (R-21)
(OR)
Consider the binary search tree given bellow. Find the result of in-ortder, pre-order , and post-order
traversals. Show the deletion of the root node Insert 11,22,33,44,55,66,and 77 in the tree (APR/MAY
22)
3. i. Explain binary tree ADT
ii. Write a Python code to insert a node in binary search tree. Explain it with suitable
example.
4. Construct a binary tree having the following sequence:
i. Preorder Sequence ABCDEFGHI,
ii. Inorder Sequence BCAEDGHFI
(OR)
The inorder and preorder traversal of a binary tree are “D B E A F C G” and “ A B D E C F G “,
respectively. What would be the postorder traversal of the binary tree? Illustrate the steps. (NOV-DEC
22) (R-21)
5. What is binary tree? Show thw array representation and linked representation for the following binary
tree.

(OR)
For the given data draw a binary search tree and show the array representation of the same: 100 80 45 55
110 20 70 65.
6. Write a program to create a binary search tree for the following sequence of data items.
3,1,4,9,6,5,2,8,7. Define a function to delete an node from the BST and then show the results of
deleting the nodes 3,2,7 one after the other of the constructed tree. (NOV-DEC 22)
OR
State the binary search tree property and outline the algorithm to search the binary search tree
with an example.(NOV-DEC 22) (R-21)
OR
Write the insertion algorithm for binary search tree and analyse its complexity. (NOV/DEC
2023)
7. Illustrate the procedure for constructing an expression tree for the expression : (a+b)*c^d/e-
(f+g). (NOV-DEC 22)
Illustrate the construction procedure of Expression tress with suitable example .(DEC 21, 18)
8. Exemplify the insertion operations in B+ tree, where there is an overflow in the leaf node.
(NOV-DEC 22)
9. Explain heap tree ADT in detail( APRIL-MAY 23)
(OR)
Illustrate the insertion and deletion operation performed in the binary heap. ( APR/MAY 2023)
Identify the types of priority queue. Explain about min heap insertion and deletion operations(
APRIL-MAY 23)
State algorithm to sort elements of a given array in ascending order using heap sort. Sort the following
numbers using heap sort : 48, 0, -1, 82, 108, 72, 54.
10. Explain with an example of multi-way search tree procedure. ( APR/MAY 2023)
i. B Tree
ii. B+ Tree
11. What are AVL trees? Describe the different rotation defined for AVL Tree. (Apr/May 22)
Discuss about AVL trees along with its properties and advantages with suitable example. (NOV-
DEC 23) (R-21)
OR
Summarize how rebalancing occurs in AVL trees during double rotation with example.
(NOV/DEC 2023)
12. i. Compare B trees with B+ trees
ii. Create a B+ tree of order 5 for the following data arriving in sequence 90,
27,7,9,18,21,3,4,16,11,21,72.
13. Construct an AVL tree by inserting 4,1,2,5,6,17,3, and 7 into an an initially empty tree. Show the results
of deleting the nodes 1,6,7 one after other of an constructed tree. Give the order of visiting the nodes by
applying the post order traversal algorithm. (Nov Dec 20)
14. What is a B-tree? Mention the properties that a B-tree holds. (DEC 2014)
Explain the insertion and deletion of nodes in the B-tree with suitable example.
OR
List the principles of B-trees and explain how a node can be inserted into a B- Tree with an
example. (NOV/DEC 2023)
15. Distinguish between B tree and B+ tree. Create a B tree of order 5 by inserting the following
elements: 3,14, 7,1,8,5,11,17,13,6,23,12,20,26,4,16,18,24,25 and 19. (DEC 2018)

UNIT –5 GRAPH STRUCTURES


Graph ADT – representations of graph – graph traversals – DAG – topological ordering – greedy
algorithms – dynamic programming – shortest paths – minimum spanning trees – introduction to
complexity classes and intractability
PART A
1. What is a complete graph and represent k4 graph? ( APR/MAY 2023)
2. How many edges at most can a Directed Acyclic Graph possess, with number of vertices greater
than 1.( APR/MAY 2023)
3. Define Complete Graph and Finite Graph (NOV/DEC 2023)
4. Find the number of edges present in a complete graph having n vertices. (NOV/DEC 2023)
5. Define critical path( APRIL-MAY 23)
6. State the uses of topological sort. What are the steps involved in topological sorting? ( APRIL-
MAY 23)
7. Prove that the number of odd degree vertices in a connected graph should be even. (MAY 07)
8. What is breath first traversal? (DEC 10)
9. Prove that the number of odd degree vertices in a connected graph should be even.(May 07)
10. What are the application of graph?(MAY 05)
11. Difference between weakly connected graph and strongly connected graph(DEC 21)
12. What is activity node graph? (DEC 09,MAY 07)
13. Define the length of the graph. (APR/MAY 22)
14. What are different ways to represent graph?(DEC 18)
What are the storage representation of the graph?
15. What are the various. operations that can be performed on B-tree?(MAY-16)
16. Define minimum spanning tree.(DEC 19)
Express how a graph differs from a spanning tree with an example. (NOV/DEC 2023)
17. What is topological sorting give an example? (APR/MAY 22)
18. Outline the directed graph and undirected graph with example.(NOV-DEC 22) (R-21)
19. Find the adjacency matrix and adjacency list for the following graph.

20. What is the property that makes an undirected graph as a biconnected.?(NOV-DEC 22)
21. Exemplify a weighted acyclic graph. (NOV-DEC 22)
22. When a graph is said to be bipartite? (MAY 2011)
23. What is depth first traversal? (DEC 2010)
24. Define a graph. How it differs from tree? (DEC 2016)
25. Write down the applications of spanning tree.
26. Write down the applications of greedy method.
27. Write down the steps involved in greedy method.
28. Given a weighted undirected graph with |V| nodes, Assume all weights are non negative. If each
edge has weight <=w, what can you say about the cost of Minimum spanning tree.
PART-B
1. Differentiate depth-first search(DFS) and breadth-first search in detail(BFS). ( APR/MAY 2023)
(OR)
Illustrate the depth-first search technique. ( APR/MAY 2023)
Differentiate depth first search and breath first search traversal of a graph with suitable example.
(APR/MAY 22)
Give the order of traversing the nodes using BFS algorithm with an example graph.
(OR)
Outline the breath first search traversal and depth first search traversal of a graph with an
example(NOV-DEC 22) (R-21)
2. Define graph. List the basic terminologies of graph and the operations performed on graph.
3. Define DAG. Examine the topological sorting of a graph G with an example and time
complexity. ( APR/MAY 2023)
4. Write python code for traversing a graph using DFS and BFS.
5. Give the adjacency matrix and adjacency list of a graph. Write a program to calculate the In-
degree and the out-degree of the node N in the graph with an example. (APR/MAY 22)
(OR)
What do you mean by adjacency matrix and adjacency list? Give adjacency matrix and
adjacency list of the following graph.

iii. Write a python code for creation of graph using adjacency matrix
6. The adjacency matric of four-vertex is shown in bellow figure. List the sequence of nodes visited
starting from vertex 4, in depth-first search on the graph. (NOV/DEC 2023)
- A B C D
A 0 1 0 0
B 1 0 1 0
C 0 1 0 1
D 0 0 1 0
7. Explain the design concept for topological sorting for the graph given bellow. (NOV/DEC
2023)

8. Outline the steps in the Dijkstra’s algorithm(single source shortest path algorithm) with an
example.(NOV-DEC 22) (R-21)
9. Apply an appropriate algorithm to find the shortest path (Dijkstra’s algorithm) from ‘A” to other
node of A.

(DEC 2018)
10. Consider the given undirected graph-and apply Prim's Algorithm to find the minimum spanning
tree? Illustrate the steps.( APR/MAY 2023), (NOV/DEC 2023)
(OR)
Using prims algorithm, find the cost of minimum spanning tree (MST) of the given graph. (
APRIL-MAY 23)
11. ii.Obtain the shortest path for the given graph using Dijkstra’s Algorithm

12. Using Dijkstra’s algorithm find the shortest path from the source node A.(DEC 2016)

13. Explain the various applications of graph.


14. Illustrate Kruskals algorithm to find the minimum spanning tree of a graph. Trace the algorithm
for the following graph. (APR/MAY 22), (NOV-DEC 23) (R-21)

Outline the steps in constructing a minimal spanning tree using Kruskals algorithm and apply the
algorithm for the weighted undirected graph with examples.(DEC 22 )
15. Write the python program to implement the Prim’s algorithm.

Signature of the faculty Signature of the HOD

You might also like