# Data Structures and Algorithms - Unit Wise Questions

Unit 1: Introduction to Data Structures & Algorithms
28 Questions

1. What is stack? What are the different applications of stack? Explain stack operations with example.(1 + 3 + 7)

10 marks | Asked in 2077

2. Differentiate between singly linked list and doubly linked list. How do you insert and delete a node from doubly linked list? Explain.(3+7)

10 marks | Asked in 2077

3. What is shortest path? Explain Dijkstra algorithm for finding shortest path using suitable example.(2+8)

10 marks | Asked in 2077

4. How do you find complexity of algorithms? Explain.

5 marks | Asked in 2078

4. Differentiate between structure and union.

5 marks | Asked in 2074 |

4. What do you mean by complexity of algorithms? How do you find time complexity?

5 marks | Asked in 2075 |

4. Discuss array as an ADT.

5 marks | Asked in 2071 |

4. What are the difference between two dimension array and multidimension array?

5 marks | Asked in 2065 |

4. What is dynamic memory allocation? Compare data structure with abstract data type.(2+3)

5 marks | Asked in 2077

5. “To write an efficient program, we should know about data structures.” Explain the above statement.

5 marks | Asked in 2066

5. Explain algorithm for evaluation of postfix expression using stack.(5)

5 marks | Asked in 2077

5. What are the major characteristics of algorithms?

5 marks | Asked in 2065 |

5. What is an algorithm? What is to analyze in algorithm? Define Big  Oh notation for time complexity measurement of algorithm.

5 marks | Asked in 2070 |

5. Differentiate between array and pointer with example.

5 marks | Asked in 2072 |

5. Describe the Big 'O' notation.

5 marks | Asked in 2074 |

6. What is an algorithm? Write down the features of an algorithm.

5 marks | Asked in 2072 |

6. Explain queue as an ADT.(5)

5 marks | Asked in 2077

7. Write a recursive program to find GCD of two numbers.(5)

5 marks | Asked in 2077

8. What is linked list? How is it different from array?(2+3)

5 marks | Asked in 2077

9. Hand test bubble sort with array of numbers 53, 42, 78, 3, 5, 2, 15 in ascending order.(4+1)

5 marks | Asked in 2077

10. What is hashing? Explain concept of hash table and hash function with example.(1 + 4)

5 marks | Asked in 2077

11. Explain the use of Big O notation in analyzing algorithms. Compare sorting time efficiencies of Quick-Sort and Merge-Sort.

5 marks | Asked in 2066 |

11. Justify the statement: “To write an efficient program, we should know about data structures and algorithms”.

5 marks | Asked in 2067

11. What is Big ‘O’ notation? Analyze any one sorting algorithm.

5 marks | Asked in 2069 |

11. What is dynamic memory allocation? How it is achieved for declaring two dimensional array? Explain.

5 marks | Asked in 2070 |

11. How to find complexity of algorithms? Explain.

5 marks | Asked in 2071 |

11. What is minimum spanning tree? Explain.(5)

5 marks | Asked in 2077

12. Write short notes on: (2 x 2.5 = 5)

a. Tail recursion            b. Collision resolution techniques

5 marks | Asked in 2077

Unit 2: Stack
16 Questions

1. What is stack? How is it different from queue? Write a program to implement all stack operations.

10 marks | Asked in 2071 |

1. How can you use stack to convert an infix expression to postfix? Convert infix expression (A + B)*(C - D) to postfix using stack.

10 marks | Asked in 2075 |

1. Write a menu program to demonstrate the simulation of stack operations in array implementation.

10 marks | Asked in 2066 |

1. Define stack as ADT. Describe its primitive operations on Array implementation and linked list implementation.

10 marks | Asked in 2067 |

1. Trace out Infix to Postfix conversion algorithm with given Infix expression.

A + (((B-C) * (D-E) + F)/G) \$ (H-I)

Evaluate the postfix expression acquired from above for the given values:

A = 6, B = 2, C = 4, D = 3, E = 8, F = 2, G = 3, H = 5, I = 1.

10 marks | Asked in 2070 |

2. What is Postfix expression? Write an algorithm to evaluate value of postfix expression. Trace the following expression into postfix expression.

(A+B*C)+(D-E/ F)

10 marks | Asked in 2072 |

3. Explain the implementation of stack and queue with example.

10 marks | Asked in 2065 |

3. Explain In-fix to Postfix Conversion Algorithm. Illustrate it with an example. What changes should be made for converting postfix to prefix.

10 marks | Asked in 2068 |

3. Explain the algorithms for infix to postfix conversion and evaluation of postfix expression. Trace the algorithms with suitable example.

10 marks | Asked in 2069 |

5. Evaluate the expression ABCD-x+ using stack where A=5, B=4, C=3 and D=7.

5 marks | Asked in 2078

5. Construct an expression tree from the following postfix:

AB + C*DC – -FG + \$

5 marks | Asked in 2067 |

5. Transform the postfix expression AB − C + DEF − + \$ to infix.

5 marks | Asked in 2071 |

6. How can you convert from infix to post fix notation?

5 marks | Asked in 2065 |

5 marks | Asked in 2075 |

6. Explain the infix to post fix conversion algorithm.

5 marks | Asked in 2074 |

7. How stack as ADT? Explain with example.

5 marks | Asked in 2072 |

Unit 3: Queue
11 Questions

1. Define queue. What are different applications of queue? Explain queue operations with example.    (1+2+7)

10 marks | Asked in 2078

1. Define Queue as an ADT. Write a program for basic operations in Linear queue in array implementation.

10 marks | Asked in 2068 |

1. Define Queue as ADT. Describe its primitive operation on array implementation and linked list implementation.

10 marks | Asked in 2069 |

3. What is circular queue? Write an algorithm and C function to implement Circular queue.

10 marks | Asked in 2072 |

6. What is priority queue? Why do we need this type of queue?

5 marks | Asked in 2078

4. Write C function to insert an item circular queue in array implementation. Write assumptions, you need.

5 marks | Asked in 2070 |

5. Compare stack with queue. How is linear queue different from circular queue?

5 marks | Asked in 2075 |

6. Write C function to display all the items in a circular queue in array implementation. Write assumptions, you need.

5 marks | Asked in 2066 |

7. How can you use Queue as ADT?

5 marks | Asked in 2065 |

7. Describe circular Queue operations in array implementation.

5 marks | Asked in 2067 |

13. What is priority queue? How it is best implemented?

5 marks | Asked in 2067 |

Unit 4: Recursion
14 Questions

2. Why recursion is required? Explain with Tower-of-Hanoi example. How recursive algorithm makes program effective? Write the merits and demerits of recursion in Programming.

10 marks | Asked in 2068 |

2. What do you mean by recursion? Explain the implementation of factorial and Fibonacci sequences with example.

10 marks | Asked in 2065 |

4. State TOH problem. Write recursion tree when no. of disks are four.

5 marks | Asked in 2069 |

4. Consider the function:

Void transfer (int n, char from, char to, char temp)

{

if (n > 0)

{

transfer ( n – 1, from, temp, to);

Printf ( “Move Disk % d from % C to % C” N, from, to);

transfer ( n – 1, temp, to, from);

}

}

Trace the output with the function Call:

transfer ( 3, "R‟, "L‟, „"C‟);

5 marks | Asked in 2066 |

4. Write recursive algorithm to get Fibonacci term. Illustrate it drawing recursion tree.

5 marks | Asked in 2067 |

4. What is Recursion? Write a recursive algorithm to implement binary search.

5 marks | Asked in 2072 |

7. Write recursive program to find nth fibonacci number.

5 marks | Asked in 2078

6. What is recursion? Write a recursive program to find factorial of a number.

5 marks | Asked in 2071 |

6. State TOH problem. Explain a recursive algorithm to solve the problem.

5 marks | Asked in 2070 |

7. Explain the Tower of Hanoi (TOH) with practical example.

5 marks | Asked in 2074 |

7. Define recursive algorithm? How do you implement recursive algorithms while writing computer programs?

5 marks | Asked in 2075 |

11. Write merits and demerits of recursive function over non-recursive function.

5 marks | Asked in 2068 |

12. Write an algorithm to implement tower of Hanoi.

5 marks | Asked in 2072 |

12. Explain the tower of Hanoi algorithm.

5 marks | Asked in 2065 |

Unit 5: Lists
17 Questions

2. Explain circular linked list with example. How do you implement linked list operation in singly linked list? Explain.    (4+6)

10 marks | Asked in 2078

2. State relative merits and demerits of contiguous list and Linked list. Explain the steps involved in inserting and deleting a node in singly linked list.

10 marks | Asked in 2066 |

2. Explain the structure of Doubly Linked List (DLL). Differentiate the difference between DLL and Doubly Circular Linked List (DCLL). Explain the procedures to insert a node in DLL at the beginning and at the last.

10 marks | Asked in 2070 |

2. What is linked list? Explain the process of inserting and removing nodes from a linked list.

10 marks | Asked in 2071 |

2. What do you mean by circular list? Differentiate between stack as a circular list and Queue as a circular list.

10 marks | Asked in 2074 |

8. Explain array implementation of lists.

5 marks | Asked in 2078

6. Differentiate between contiguous list and linked list with examples.

5 marks | Asked in 2068 |

6. Differentiate between Singly linked list, DLL, CLL and DCLL.

5 marks | Asked in 2067 |

8. Write an algorithm and C function to delete node in singly link list.

5 marks | Asked in 2072 |

8. How do you insert a nodes at last in doubly linked list? Explain.

5 marks | Asked in 2069 |

8. What do you mean by double linked list? Explain with example.

5 marks | Asked in 2074 |

8. What are the benefits of using linked list over array? How can you insert a node in a singly linked list?

5 marks | Asked in 2075 |

9. Explain why linked list is called dynamic list? Write the algorithm for deleting a new node before a node.

5 marks | Asked in 2068 |

12. Discuss the merits and demerits of contiguous list and linked list.

5 marks | Asked in 2067 |

12. Explain CLL, DLL, DCLL (Circular, Doubly, Doubly Circular Linked List).

5 marks | Asked in 2066 |

13. State relative merits & demerits of contiguous list and linked list.

5 marks | Asked in 2069 |

13. Write short notes on (any two):

a) Queue in circular linked list

c) MST (Minimum Cost Spanning Tree) of a graph.

5 marks | Asked in 2070 |

Unit 6: Sorting
16 Questions

2. Explain concept of divide and conquer algorithm. Hand test quick algorithm with array of numbers (78, 34, 21, 43, 7, 18, 9, 56, 38, 19). What is time complexity of quick sort algorithm?

10 marks | Asked in 2075 |

3. What are external and internal sorting? Explain partition strategies of Merge sort and Quick sort. Trace these sort algorithms for following data:

11  45  61  33  55  9  83  25

10 marks | Asked in 2067 |

5. Write a program in C for bubble sorting.

5 marks | Asked in 2068 |

6. Compare partition strategies of Merge sort and Quick sort.

5 marks | Asked in 2069 |

7. Trace selection – sort algorithm for the following data:

42, 23, 74, 11, 65, 58, 94, 86

5 marks | Asked in 2070 |

7. Explain Divide and Conquer algorithm taking reference to Merge Sort.

5 marks | Asked in 2066 |

7. Explain Bubble sort algorithm. Illustrate it with an example.

5 marks | Asked in 2069 |

9. Hand test selection sort with array of numbers 4, 71, 32, 19, 61, 2, -5 in descending order.

5 marks | Asked in 2078

8. Write a program to sort an array using selection sort.

5 marks | Asked in 2071 |

9. Write an algorithm and C function for merge sort.

5 marks | Asked in 2072 |

9. What is sorting? Describe the Insertion sort.

5 marks | Asked in 2065 |

12. Write short notes on:    (2 x 2.5 = 5)

a) Divide and conquer sorting

b) AVL tree

5 marks | Asked in 2078

11. Differentiate between selection sort and bubble sort.

5 marks | Asked in 2072 |

11. What do you mean by sorting? Explain the Bubble sort with example.

5 marks | Asked in 2074 |

12. Hand test the insertion sort algorithm with following array of numbers.

16  7  31  2  9  41  -10

5 marks | Asked in 2071 |

13. Discuss merge sort. How you rate this sorting from selection sort?

5 marks | Asked in 2068 |

Unit 7: Searching and Hashing
18 Questions

7. Explain binary search. Illustrate it with example.

5 marks | Asked in 2068 |

8. Trace Binary Search algorithm for the data:

21, 36, 56, 79, 101, 123, 142, 203

And Search for the values 123 and 153.

5 marks | Asked in 2066 |

10. Write a program to implement sequential search algorithm.

5 marks | Asked in 2078

8. Explain hashing with example.

5 marks | Asked in 2068 |

8. What is Hashing? What collision means? State collision resolution techniques. Explain one of them in brief.

5 marks | Asked in 2070 |

8. Compare and Contrast between Binary searching and Binary tree searching.

5 marks | Asked in 2067

9. How do you implement binary search algorithm? What is time complexity of this algorithm?

5 marks | Asked in 2075 |

9. Discuss binary search technique along with its efficiency.

5 marks | Asked in 2071 |

9. Describe recursive procedure of Binary searching technique? Discuss about efficiency of Binary searching.

5 marks | Asked in 2069 |

9. State collision resolution techniques in hashing. Explain double hashing and quadratic probing techniques.

5 marks | Asked in 2067 |

10. Explain the binary searching.

5 marks | Asked in 2065 |

10. What are Hashing and collision? Write about any three hashing algorithms.

5 marks | Asked in 2069 |

10. Why do we need Hashing? Discuss linear probing in detail.

5 marks | Asked in 2071 |

10. What is hashing? Discuss rehashing with example.

5 marks | Asked in 2075 |

12. Explain efficiency of

a) Binary Searching

b) Quick sort

5 marks | Asked in 2070 |

12. Differentiate between sequential searching and binary searching.

5 marks | Asked in 2074 |

13. Write Short notes on (any two):

a) Hash function

b) External Sorting

5 marks | Asked in 2066 |

13. Write short notes on

a) Hashing

5 marks | Asked in 2072 |

Unit 8: Trees and Graphs
33 Questions

1. What is binary search tree? Explain with an example. Write an algorithm to search, insert and delete node in binary search tree.

10 marks | Asked in 2072 |

1. Illustrate the algorithm for Binary search tree with example.

10 marks | Asked in 2074 |

1. What do you mean by binary tree? Explain the binary search tree with example.

10 marks | Asked in 2065 |

2. Describe properties of Binary Search Tree. Write recursive algorithms for constructing BST and its traversals. Illustrate them with an example.

10 marks | Asked in 2067 |

2. Describe the significance of Huffman tree. Describe procedure for construction of a Huffman tree. Illustrate it with example. Describe different types of applications of Binary trees.

10 marks | Asked in 2069 |

3. What is binary search tree? Write a program to implement insertion and deletion algorithm in binary search tree?    (2+8)

10 marks | Asked in 2078

3. A binary tree T has 12 nodes. The in-order and pre-order traversals of T yield the following sequence of nodes:

In-order : VPNAQRSOKBTM

Pre-order : SPVQNARTOKBM

Construct the Binary tree T showing each step. Explain, how you can arrive at solution in brief?

10 marks | Asked in 2066 |

3. Define Binary Search Tree (BST). Write an algorithm to insert a node in non-empty BST. Construct BST from the data:

10, 20, 30, 25, 27, 7, 4, 23, 26, 21.

10 marks | Asked in 2070 |

3. Discuss depth first and breadth first traversal of a graph with suitable example.

10 marks | Asked in 2075 |

3. Explain the procedure for construction of Huffman algorithm with example.

10 marks | Asked in 2074 |

3. What is graph traversal? Discuss depth-first traversal technique with suitable example.

10 marks | Asked in 2071 |

4. Explain Kruskal’s algorithm with example.

5 marks | Asked in 2068 |

5. Write about applications of Binary trees.

5 marks | Asked in 2069 |

7. Explain almost complete binary tree with example.

5 marks | Asked in 2071 |

8. What is Post-order traversal?

5 marks | Asked in 2065 |

11. What is graph traversal? Explain.

5 marks | Asked in 2078

9. Differentiate between tree and graph. What are spanning forest and spanning tree. Explain MST (Minimum cost Spanning Tree) problem.

5 marks | Asked in 2066 |

9. What is weighted graph? Explain Depth-first traversal of a graph.

5 marks | Asked in 2070 |

9. What are the types of binary tree? Compare between them.

5 marks | Asked in 2074 |

10. Explain the characteristics of Huffman’s algorithm and its application.

5 marks | Asked in 2068

10. A file contains 100 symbols in which following character with their probability of occurrence. Build a Huff man tree according to Greedy Strategy.

5 marks | Asked in 2066 |

10. Create a Huffman tree for the following set of data:

5 marks | Asked in 2070 |

10. What do you mean by graph traversal? Explain prim's algorithm with example.

5 marks | Asked in 2072 |

10. Differentiate between pre-order traversal and in order traversal.

5 marks | Asked in 2074 |

10. State MST (Minimum Cost Spanning Tree) problem and shortest path (single source and all other destination) problem. Name the algorithms for solving these problems.

5 marks | Asked in 2067 |

11. Differentiate between Pre-order and In order traversal.

5 marks | Asked in 2065 |

11. How do you transverse a binary tree? Discuss.

5 marks | Asked in 2075 |

12. Write the steps involved in deleting a node in a Binary search tree.

5 marks | Asked in 2068 |

12. Write short notes on:

(a) Dynamic memory allocation

(b) Game tree

5 marks | Asked in 2075

12. Describe strong and weekly connected graphs with examples. What is weighted graph?

5 marks | Asked in 2069 |

13. Explain the Kruskal‟s algorithm.

5 marks | Asked in 2065 |

13. Discuss the Kruskal's algorithm with example.

5 marks | Asked in 2074 |

13. Write short notes on:

a. Tree traversal

b. Circular queue

5 marks | Asked in 2071 |