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

HANDTAILORED

The document consists of a comprehensive set of questions divided into four units covering various data structures and algorithms. Topics include definitions and properties of data structures like arrays, stacks, queues, linked lists, trees, graphs, and sorting algorithms, along with their applications and algorithms for operations like insertion, deletion, and traversal. Additionally, it addresses advanced concepts such as hashing, recursion, and specific algorithms like Dijkstra's and Kruskal's for graph processing.

Uploaded by

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

HANDTAILORED

The document consists of a comprehensive set of questions divided into four units covering various data structures and algorithms. Topics include definitions and properties of data structures like arrays, stacks, queues, linked lists, trees, graphs, and sorting algorithms, along with their applications and algorithms for operations like insertion, deletion, and traversal. Additionally, it addresses advanced concepts such as hashing, recursion, and specific algorithms like Dijkstra's and Kruskal's for graph processing.

Uploaded by

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

Unit 1 (46 Questions)

1. Define Data Structure. What are the different types of data structures?

2. Explain the concept of a Linear Data Structure with examples.

3. Differentiate between Linear and Non-linear data structures with suitable examples.

4. What is an Array? Explain its properties and types.

5. How do you perform the following operations on an array: insertion, deletion, and
searching?

6. What are the advantages and disadvantages of an Array?

7. Explain the concept of a Stack with an example. How is it different from a Queue?

8. Write an algorithm for pushing an element into a stack.

9. Write an algorithm for popping an element from a stack.

10. What is a Queue? Explain its types: Simple Queue, Circular Queue, and Deque.

11. Write an algorithm for enqueue and dequeue operations in a simple queue.

12. Explain how a Circular Queue works. Write the algorithm for insertion and deletion.

13. Define the term "Linked List". What are the types of Linked Lists?

14. Write an algorithm for inserting a node at the beginning of a linked list.

15. Write an algorithm for deleting a node from a linked list.

16. Explain the concept of a Doubly Linked List and how it differs from a singly linked list.

17. Write an algorithm to traverse a singly linked list.

18. What is the importance of the "head" pointer in a linked list?

19. What are the applications of a Linked List?

20. What is a Circular Linked List? Explain its types with examples.

21. Define the concept of a Tree. What are the different types of trees?

22. What is a Binary Tree? Explain its types and properties.

23. Explain the different types of traversals in a binary tree: pre-order, in-order, and post-order.

24. How is a binary tree different from a binary search tree (BST)?

25. Write an algorithm to search for an element in a binary search tree (BST).

26. What is the time complexity of searching, insertion, and deletion in a binary search tree
(BST)?

27. Explain the concept of a Hash Table and its use in data structures.

28. What are the common hashing techniques used to resolve collisions in a hash table?
29. Define the term "Collision" in a Hash Table. What are the methods to handle collisions?

30. What is a Hash Function? How does it work, and what are its properties?

31. Explain the difference between open addressing and chaining in the context of a hash table.

32. What is a Priority Queue? Explain its implementation using a binary heap.

33. How do you implement a priority queue using a max heap and a min heap?

34. Write an algorithm to insert an element into a priority queue.

35. What is a graph? Explain its types: directed, undirected, weighted, and unweighted.

36. How do you represent a graph in memory? Explain adjacency matrix and adjacency list
representations.

37. What is the difference between a directed graph (digraph) and an undirected graph?

38. Explain the concept of a weighted graph. How is it represented?

39. Define a "Forest" in the context of trees. How is it related to a graph?

40. What is the difference between a tree and a graph?

41. What is a Binary Search Tree (BST)? How is it different from a binary tree?

42. Define the concept of a traversal in a graph. Discuss the different graph traversal algorithms.

43. What is the depth-first search (DFS) traversal? Explain with an example.

44. What is the breadth-first search (BFS) traversal? Explain with an example.

45. What is the application of graphs in real life? Explain a few use cases.

46. Discuss the various ways of implementing a graph. What are the advantages and
disadvantages of each method?

Unit 2 (34 Questions)

1. Syntax to check that a circular queue is full or empty.

2. What is recursion? Give advantages and disadvantages.

3. Explain Tower of Hanoi (TOH). Write its recursive algorithm to solve it.

4. Implement a circular queue using an array. Write all operations of a circular queue.

5. Applications of stack.

6. Explain tail recursion.

7. Push and pop operations in stack.

8. Differentiate between iteration and recursion.

9. Solution for Tower of Hanoi (TOH).


10. Explain Tail Recursion with a suitable example.

11. Write the full and empty condition for a circular queue data structure.

12. Evaluate the following postfix expression using a stack: 2 3 9 * + 2 3 ^ - 6 2 / +. Show the
contents of each and every step. Also, find the equivalent prefix form of the above
expression. Where ^ is an exponent operator.

13. Convert the following infix expression to reverse Polish notation using a stack: x = -b + √(b^2 -
4ac) / 2a.

14. Write a C program to implement a stack using a single linked list.

15. Rank the following typical bounds in increasing order of growth rate: O(log n), O(n^4), O(1),
O(n^2 log n).

16. What is tail recursion? Explain with a suitable example.

17. What is recursion?

18. Write a C program to calculate the factorial of a number using both recursive and non-
recursive functions.

19. Write the condition for empty and full circular queue.

20. What do you understand by tail recursion?

21. Which data structure is used to perform recursion and why?

22. What is Stack? Write a C program for linked list implementation of a stack.

23. Write an algorithm for converting an infix expression into a postfix expression. Trace your
algorithm for the infix expression Q into its equivalent postfix expression P: Q: A + ( B * C –
( D / E ^ F) * G ) * H.

24. What is a circular Queue? Write a C code to insert an element into a circular queue.

25. In the reference of the Tower of Hanoi problem, if there are 7 disks, solve the number of
years it will need to move from one tower to another, assuming that one move takes 1
second.

26. Explain circular queue. What is the condition if the circular queue is full?

27. Implement C language to print Fibonacci series using recursive and non-recursive functions.

28. Write an algorithm to evaluate a postfix expression and find the value of 7, 5, 2, -, *, 4, 1, 5, -,
/, +.

29. Write an algorithm to convert a valid arithmetic infix expression into an equivalent postfix
expression. Trace your algorithm for the following infix expression: A + B * C - D / F.

30. Write an algorithm to evaluate an arithmetic expression using a stack and show how the
expression 3 * (5 - 3) will be evaluated.

31. A double-ended queue (deque) is a linear list in which additions may be made at either end.
Obtain a data representation mapping a deque into one-dimensional array. Write a C
function to add and delete elements from either end of the deque.
32. Discuss the various conditions for an empty and full circular queue data structure.

33. Implement a program in C for reversing a string using a stack.

34. What is the difference between iteration and recursion in the context of algorithm design?

Unit 3 (39 Questions)

1. Stable and in-place sorting.

2. Algorithm for quick sort.

3. Priority queue and its application.

4. Bubble sort working.

5. How binary search is different from linear search. Give complexity of these.

6. Difference between BST and heap.

7. Quick sort and its algorithm.

8. Hashing, hash function, and collision resolution technique in hashing.

9. Examine the minimum number of interchanges needed to convert the array 90, 20, 41, 18,
13, 11, 3, 6, 8, 12, 7, 71, 99 into a maximum heap.

10. Differentiate sequential search and binary search.

11. Explain any three commonly used hash functions with a suitable example. A hash function
H(key) = key % 7, with linear probing, is used to insert the keys 37, 38, 72, 48, 98, 11, 66 into
a table indexed from 0 to 6. What will be the location of key 11? Justify your answer, also
count the total number of collisions in this probing.

12. Write an algorithm for merge sort and apply it on the following elements: 45, 32, 65, 76, 23,
12, 54, 67, 22, 87.

13. C program for index sequential search.

14. Draw the binary search tree that results from inserting the following numbers in sequence
starting with 11: 11, 47, 81, 9, 61, 10, 12.

15. Give an example of one stable and one unstable sorting technique.

16. Write algorithms for insertion sort. Implement the same on the following numbers: 13, 16,
10, 11, 4, 12, 6, 7. Also, calculate its time complexity.

17. Differentiate between linear and binary search algorithm. Write a recursive function to
implement binary search.

18. (i) Use the merge sort algorithm to sort the following elements in ascending order: 13, 16,
10, 11, 4, 12, 6, 7.

19. What is the time and space complexity of merge sort?


20. (ii) Use the quick sort algorithm to sort 15, 22, 30, 10, 15, 64, 1, 3, 9, 2. Is it a stable sorting
algorithm? Justify.

21. (i) The keys 12, 17, 13, 2, 5, 43, 5 and 15 are inserted into an initially empty hash table of
length 15 using open addressing with hash function h(k) = k mod 10 and linear probing. What
is the resultant hash table?

22. (ii) Differentiate between linear and quadratic probing techniques.

23. Differentiate between binary search tree and a heap.

24. Differentiate between internal sorting and external sorting.

25. Write an algorithm for Quick sort. Use Quick sort algorithm to sort the following elements: 2,
8, 7, 1, 3, 5, 6, 4.

26. What is Hashing? Explain the division method to compute the hash function and also explain
the collision resolution strategies used in hashing.

27. (b) Write an algorithm for Heap Sort. Use Heap sort algorithm, sort the following sequence:
18, 25, 45, 34, 36, 51, 43, 24.

28. Differentiate strict and complete binary tree.

29. (f) Define Binary heaps.

30. Differentiate between internal and external sorting.

31. State the number of swaps performed by bubble sort to sort the following array of integers:
9, 2, 3, 5, 4, 1, 10, 8, 7.

32. (a) Write an algorithm for Merge Sort. Explain with the help of a suitable example.

33. (b) Construct a B-Tree of order 5 with the following sequence of integers: 10, 90, 20, 80, 30,
70, 40, 60, 50, 35, 55, 15, 25, 5, 75, 85, 95, 45, 100, 22, 12.

34. How the choice of pivot element affects the running time of the quick sort algorithm?

35. What are the 2 different forms of hashing?

36. What are the disadvantages of linear probing in hashing? Discuss how quadratic probing can
be used to solve some of these problems.

37. Write a C program for sorting 100 integer numbers using the selection sort procedure.
Discuss the worst-case time complexity of the algorithm.

38. (b) Write a program in C language to implement binary search algorithm. Also, discuss the
average behavior of the algorithm.

39. How can you optimize sorting techniques in large data sets, considering both time and space
complexities?

Unit 4 (64 Questions)


1. Define binary tree and explain the structure with a suitable diagram.

2. How to represent an expression tree for the expression a + b * c? Show the steps for
constructing the tree.

3. How do you traverse a binary tree? Explain pre-order, in-order, and post-order traversals.

4. Given a binary tree, write an algorithm to perform in-order traversal.

5. Write an algorithm to count the number of nodes in a binary tree.

6. What is the height of a binary tree? How can it be calculated recursively?

7. How to delete a node in a binary search tree (BST)? Explain the different cases with an
example.

8. Explain the concept of a complete binary tree and provide an algorithm to check if a given
tree is complete.

9. Explain the concept of a full binary tree and provide an algorithm to check if a given tree is
full.

10. Define a perfect binary tree. How does it differ from a full binary tree?

11. What is a height-balanced binary tree (AVL tree)? Explain why it is important in maintaining
balanced operations.

12. What is a binary heap? Discuss both max-heap and min-heap.

13. Write an algorithm for inserting an element into a max-heap.

14. Write an algorithm for deleting an element from a max-heap.

15. Discuss the time complexity of insertion and deletion operations in a binary heap.

16. Write an algorithm to construct a max-heap from an unsorted array.

17. Define the term "Minimum Cost Spanning Tree" (MCST). What are its applications?

18. Explain Kruskal’s algorithm for finding the minimum spanning tree. Provide a numerical
example.

19. Explain Prim’s algorithm for finding the minimum spanning tree. Provide a numerical
example.

20. What is a threaded binary tree? Explain its advantages over a normal binary tree.

21. Define a binary search tree (BST). Write an algorithm to search for a node in a BST.

22. What is the time complexity of searching, insertion, and deletion operations in a BST?

23. Write an algorithm for inserting a node into a binary search tree.

24. Write an algorithm to delete a node from a binary search tree (BST).

25. What are the different types of binary trees? Discuss each type briefly.

26. Explain the concept of a balanced tree. What is its significance in binary tree operations?
27. Define a B-tree and explain its structure. Discuss its application in databases.

28. Discuss the insert and delete operations in a B-tree. Provide examples.

29. What is an AVL tree? How does it maintain balance during insertion and deletion operations?

30. What is the process of balancing an AVL tree after insertion?

31. What is the process of balancing an AVL tree after deletion?

32. Write an algorithm for performing a right rotation in an AVL tree.

33. Write an algorithm for performing a left rotation in an AVL tree.

34. Write a program to perform in-order, pre-order, and post-order traversal of an AVL tree.

35. Write advantages of AVL tree over a binary search tree (BST).

36. What is the significance of maintaining the balance factor in an AVL tree? How is it
calculated?

37. Differentiate between depth-first search (DFS) and breadth-first search (BFS).

38. Explain how DFS works with a suitable example.

39. Explain how BFS works with a suitable example.

40. Implement BFS in a graph using an adjacency list representation.

41. Implement DFS in a graph using an adjacency list representation.

42. What is the difference between a DFS traversal and BFS traversal in a graph?

43. What is a minimum spanning tree (MST)? Explain its importance with applications.

44. Discuss the Bellman-Ford algorithm for finding the shortest path in a weighted graph.

45. Discuss Dijkstra’s algorithm for finding the shortest path in a weighted graph.

46. Explain the differences between Dijkstra’s algorithm and Bellman-Ford algorithm.

47. What is the topological sort of a directed acyclic graph (DAG)? Explain with an example.

48. Write an algorithm to find the topological sort of a DAG.

49. What is a Hamiltonian cycle? How can it be found in a graph?

50. What is a Hamiltonian path? How can it be found in a graph?

51. Explain Eulerian circuits and paths. How can we determine if a graph has an Eulerian circuit
or path?

52. Discuss the traveling salesman problem. Explain how to solve it using brute force.

53. What is a bipartite graph? How can we check if a graph is bipartite?

54. Explain the Ford-Fulkerson algorithm for finding the maximum flow in a flow network.

55. What is a flow network? How is it used in the context of the Ford-Fulkerson algorithm?

56. What is the concept of graph coloring? How can we solve graph coloring problems?
57. Explain the concept of reachability in a graph.

58. What is the importance of graph theory in network design and other real-world applications?

59. Discuss how to represent a graph using an adjacency matrix and an adjacency list. Compare
their advantages and disadvantages.

60. Explain the time complexity of the depth-first search (DFS) and breadth-first search (BFS)
algorithms.

61. What is the use of a priority queue in graph algorithms? How is it used in Dijkstra’s
algorithm?

62. Explain the differences between a depth-first search and a breadth-first search when applied
to a graph.

63. Discuss the significance of cycles in graphs. How can we detect cycles in a directed graph?

64. Write a C program to implement graph traversal algorithms like DFS and BFS on a graph
represented as an adjacency list.

Unit 5 (26 Questions)

1. How graph can be represented in memory. Explain with an example.

2. Floyd Warshall algorithm.

3. Explain graph traversal techniques in detail with examples.

4. Compare adjacency matrix and adjacency list representation of graphs.

5. Warshall algorithm with example.

6. Dijkstra algorithm.

7. Differentiate sequential search and binary search.

8. Differentiate sequential search and binary search.

9. If the in-order of a binary tree is B, I, D, A, C, G, E, H, F and its post-order is I, D, B, G, C, H, F,


E, A, then draw the corresponding binary tree with neat and clear steps from above
assumption.

10. Write different representations of graphs in memory.

11. Use Dijkstra’s algorithm to find the shortest paths from source to all other vertices in the
following graph.

12. Apply Prim’s algorithm to find a minimum spanning tree in the following weighted graph as
shown below.

13. (h) Write an algorithm for Breadth First Search (BFS) traversal of a graph.
14. Write the Dijkstra algorithm for the shortest path in a graph and also find the shortest path
from ‘S’ to all remaining vertices.

15. Write and explain the Floyd Warshall algorithm to find the all pair shortest path. Use the
Floyd Warshall algorithm to find the shortest path among all the vertices in the given graph.

16. Explain Transitive closure of a Graph.

17. (h) List the different types of representation of graphs.

18. (a) Write short notes on the following: (i) Topological Sort (ii) Activity Network

19. (b) Differentiate between Breadth First Search (BFS) and Depth First Search (DFS) with
suitable examples.

20. What is the number of edges in a regular graph of degree d and n vertices?

21. Write an algorithm to compute the indegree and outdegree of every vertex of a directed
graph when the graph is represented by an adjacency matrix.

22. Explain the concept of a strongly connected component in a directed graph.

23. Describe how a depth-first search (DFS) can be used to find a strongly connected component.

24. In the context of a graph, define the concepts of directed and undirected graphs. Provide
examples.

25. Write a C program to implement the graph representation using an adjacency list.

26. Find the minimum spanning tree using Prim’s algorithm for the graph shown below.

You might also like