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

DSA Question Bank

Uploaded by

17anilrathore
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)
25 views

DSA Question Bank

Uploaded by

17anilrathore
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/ 8

Question Bank

Subject :- Data structure & Algorithms


Subject Code :- BTCS 301-18
Semester :- 3rd

2 marks Questions

1. Write applications of Linked Lists


2. Distinguish between stack and queue.
3. Which are different ways of representing expressions?
4. What is garbage collection in data structure?
5. Define some applications of tree and graph.
6. Elaborate the main use of heap?
7. Define a cycle in a graph.
8. What are recursive procedures?
9. Write a short note on pointers.
10. Define Big O notation.
11. List types of operators.
12. Define priority queue
13. Discuss AVL trees.
14. What is adjacency List?
15. Write a short note on rehashing.
16. What are advantages of selection sort?
17. Write short note on space complexity
18. Advantages of doubly linked list over singly linked list.
19. Differentiate between Binary Search Tree and AVL Tree
20. What is Time complexity for searching in a BST in worst case? And Why?
21. Suggest an application of queue. Explain how queue is a better choice than array for
that application.
22. Why it is necessary to analyze an algorithm?
23. How heaps are represented in memory?
24. Define Sparse Matrices.
25. Write an algorithm to delete and node from linked list.
26. What is the need of data structure?
27. Write applications of stacks and queues.
28. What are the objectives of sorting?
29. What is Time complexity of quick sort in worst case? And why?
30. Evaluate below postfix expression. 2 3 2 ^ ^ 8 2 / / 5 2 * 6 – +
31. Write at least three differences between linear and binary search.
32. Write algorithm to implement circular queue
33. Stacks are used to implement recursion in programming languages. Explain why?
34. Give any two disadvantages of Big O notation
35. What do you mean by time space trade-off? Give example.
36. Give one advantage and one disadvantage of Binary search over Linear Search
37. Give any two applications of circular linked list
38. What are advantages of merge sort over quick sort.
39. Define complete graph and strongly connected graph.
40. Explain adjacency matrix and adjacency list representations of graph data structure
41. List the various operations that can be performed on data structure.
42. What is abstract data type? What are all not concerned in an ADT?
43. List out the areas in which data structures are applied extensively
44. State the advantages of circular lists over doubly linked list
45. What are the advantages of doubly linked list over singly linked list?
46. Why is the linked list used for polynomial arithmetic?
47. What is the basic purpose of header of the linked list?
48. What is the advantage of an ADT? How do you test for an empty Queue?
49. Define Dequeue with its types
50. Define Height and depth of a tree?
51. What are the two methods of binary tree representation in memory?
52. Define tree– traversal and mention the type of traversals?
53. What is a loop, in degree, out degree in a graph?
54. Define path in a graph?
55. What is a cycle or a circuit?
56. What is an acyclic graph?
57. What is meant by strongly connected in a graph?
58. Why bubble sort is called so?
59. State the logic of bubble sort algorithm.
60. Which sorting algorithm is easily adaptable to singly linked lists? Why?
61. Mention the different ways to select a pivot element.
62. What is divide-and-conquer strategy?
63. Which sorting algorithm is best and why?
64. What are the ways of implementing linked list?
65. What are benefits of ADT?
66. What are the advantages of linked list?
67. Explain the usage of stack in recursive algorithm implementation?
68. How do you test for an empty stack?
69. Give the applications of priority queues
70. What is a balance factor in AVL trees?
71. What is the various representation of a binary tree?
72. Define complete binary tree?
73. Define Strictly binary tree?
74. What do you mean by internal and external sorting?
75. List out the different types of hashing functions?
76. What is insertion sort? How many passes are required for the elements to be sorted?
77. Define Double Hashing.
78. What are the various factors to be considered in deciding a sorting algorithm?
79. Define separate chaining
80. What is open addressing?
81. What is Rehashing?
82. Differentiate between terminal and non-terminal nodes of a tree

5 & 10 marks Questions

1. What are the types of queues? Explain with examples.


2. What do you mean by Link list? Write an algorithm to insert and delete a node in
Singly Linked List.
3. Write an algorithm to convert infix expression to postfix expression by taking a
suitable example.
4. Write the importance of hashing. Compare direct address tables with hash tables
5. Which are the different ways of representing a graph?
6. What is Hash function? How linear probing is used to resolve collision in Hash
Tables?
7. What is Circular Linked List? State the advantages and disadvantages of Circular
link List over Doubly Linked List and Singly Linked List.
8. Write the advantage and disadvantage of Array and Link List data structures.
9. What is algorithm complexity? How it is measured?
10. Illustrate the concept of depth-first search traversing of graph.
11. Explain various methods in which a binary tree can be represented. Write any one
in detail with example.
12. Write an algorithm to sort an array of integers in the descending order using bubble
sort.
13. Explain with example insertion and deletion in a B+ tree
14. Construct MAX-HEAP for the following input by inserting elements one after
another. Show heap after each iteration. 20, 55, 16, 102, 13, 78, 94
15. Convert the following infix expression to postfix. Illustrate each step clearly.
i. a*(b ^ c (d/e – f) ^ g) + h
16. Write the algorithm for pre-order tree traversal. Also show the steps of this
algorithm on an example set of numbers.
17. Compare quick and merge sort for best, average and worst case scenarios with help
of examples for each.
18. Array and binary heap can be used to implement priority queue. Compare these
methods with respect to time complexity for insertion and deletion
19. Are B trees of order 2 are full binary trees? If yes, explain how
20. Explain push(), pop(), isEmpty(), isfull() and peek() operations of Stacks? What is
the time efficiency of these operations?
21. What is disadvantage of simple queue over linear queue in array implementation of
Queue? Explain with example
22. Make a binary search tree by considering the following eight numbers and write an
algorithm to search element ‘24’ in given BST------55, 34, 41, 24, 74, 38, 65, 49
23. Write an Algorithm to traverse a graph using Breadth First Search.
24. Build a heap H from the following list of numbers and apply Heap sort with suitable
algorithms.--------------- 42, 35, 5, 8, 34, 56, 70, 32
25. Consider an array: 99, 2, 34, 17, 75, 12 Depict the state of the array after each pass
if selection sort is applied
26. Why binary search cannot be performed on linked list? Justify your answer with
suitable example.
27. Explain the mechanisms of deleting an element from stack and queue by showing
suitable example.
28. Write an algorithm for searching a node from a link list.
29. Discuss merge sort with suitable example.
30. Construct a binary search tree using the following numbers. 49, 23, 37, 23, 66, 39,
59, 50 and write algorithms for insertion and deletion in BST
31. What is threaded tree? Define its type and uses with diagram.
32. Write algorithm for push, pop in a stack using linked list implementation
33. Convert the given infix expression into postfix expression using stack and show the
details of stack at each step of conversion. Expression: (a + b ^ c * d) * (e + f/g)
34. Write short note on the following:
 Breadth First Search
 Depth First Search
35. Discuss pros and cons of Adjacency matrix representation of a graph.
36. How a multidimensional array is represented in memory? Explain the program
which reads two matrices?
37. Create hash table of length 13 for the following keys entered in the same order using
below hash function. Linear probing is used to resolve collision.
Keys: {4684, 4879, 5651, 1829, 1082, 7107, 1628, 2438, 3951, 4758, 6967, 4989}
Hash function: (sum of all digits)% 13
38. Write steps to implement queue using stack i.e. implement insert and delete
operation of queue using push and pop.
39. Graph data structure can be very efficient in finding shortest path between two
cities. Show with an example.
40. Explain left and right rotations in an AVL tree.
41. Write an algorithm to insert a node in doubly linked list.
42. Differentiate between BFS and DFS in graphs.
43. Perform bubble and quick sort on given array. 55, 47, 88, 12, 30, 99, 23, 65, 71
44. Create a BST of 15 nodes. Write all 3 traversals.
45. What do you mean by infix, prefix and postfix expressions? How to evaluate
postfix? Write algorithm to explain
46. Give the algorithm of tower of Hanoi problem with ‘n’ disks. Derive total no of
moves in the problem.
47. What is BFS and DFS traversal of a graph? Give BFS and DFS traversal (starting
with node 0) of graph. Show all intermediate steps for given graph

48. A queue can be implemented using single linked list in two ways. One
implementation has front at head and rear at tail of linked list. Other implementation
has front at tail and rear at head of linked list. Which implementation among two is
efficient and why?
49. Define B Tree. Draw B Tree of order 5 for the following data-
92, 24, 6,7, 11,8, 22,4,5,16,19,20,78
50. Illustrate execution of Quick Sort ( in increasing order) for these given nos.
44,33,11,55,77,90,40,60,99,22, 88

51. Write algorithm for push, pop in a stack using array implementation
52. Write algorithm to insert and delete an element from array implementation of
circular queue.
53. What are the benefit and limitations of linked list?
54. Explain linear linked implementation of Stack and Queue?
55. What is a DeQueue? Explain its operation with example?
56. Describe the algorithms used to perform single and double rotation on AVL tree.
57. Create a binary search tree for the following numbers start from an empty binary
search tree. 45,26,10,60,70,30,40 Delete keys 10,60 and 45 one after the other and
show the trees at each stage.
58. Construct an expression tree for the expression (a+b*c) + ((d*e+f)*g). Give the
outputs when you apply inorder, preorder and postorder traversals.
59. Write complexities of Bubble sort, quick sort, merge sort, heap sort, insertion sort
and selection sort for best, worst and average case.
60. Given the input { 4371, 1323, 6173, 4199, 4344, 9679, 1989 } and a hash function
of h(X)=X (mod 10) show the resulting: a. Separate Chaining hash table b. Open
addressing hash table using linear probing
61. What are the advantages and disadvantages of various collision resolution
strategies?
62. Explain any two techniques to overcome hash collision
63. What are enqueue and dequeue operations? Write algorithm for these operations
64. Define asymptotic notations with graph and examples.
65. Write algorithm to evaluate post fix expression
66. The keys 12,18,13,2,3,23,5 and 15 are inserted into an initially empty hash table of
length 10 using open addressing with hash function h(k)=k mod 10 and linear
probing. What is the resultant Hash Table?( also show intermediate table)

You might also like