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

Data Structures and Algorithms (DSA)

Uploaded by

Saif Shaikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Data Structures and Algorithms (DSA)

Uploaded by

Saif Shaikh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Data Structures and Algorithms (DSA) course, covering a range of topics:

Short Answer Questions (2-3 Marks Each)

1. Define a data structure. Give two examples.


2. What is the difference between an array and a linked list?
3. Explain the concept of stack with an example.
4. What is a queue? How does it differ from a circular queue?
5. Define time complexity. Why is it important?
6. State the difference between linear search and binary search.
7. What is a graph? List its types.
8. Describe the concept of recursion with an example.
9. What is the difference between DFS and BFS in graph traversal?
10. Write the properties of a binary search tree (BST).

Numerical/Problem-Solving Questions (5-6 Marks Each)

11. Perform the following operations on a stack using push and pop: Sequence: PUSH(10),
PUSH(20), POP, PUSH(30), POP\text{Sequence: PUSH(10), PUSH(20), POP,
PUSH(30), POP}Sequence: PUSH(10), PUSH(20), POP, PUSH(30), POP Show the
stack after each operation.
12. Write the steps to sort the array [8,3,1,7,0,10,2][8, 3, 1, 7, 0, 10, 2][8,3,1,7,0,10,2] using
bubble sort.
13. Implement the following queue operations: Enqueue(5), Enqueue(10), Dequeue,
Enqueue(15). Show the state of the queue.
14. Represent the graph below using an adjacency matrix: Nodes: A, B, C, D; Edges: A-B,
B-C, C-D, D-A\text{Nodes: A, B, C, D; Edges: A-B, B-C, C-D, D-A}Nodes: A, B, C, D;
Edges: A-B, B-C, C-D, D-A

Given a binary tree, perform in-order, pre-order, and post-order traversals:


markdown
Copy code
5
/ \
3 7
/ \ \
2 4 8

15.
Long Answer Questions (10 Marks Each)

16. Write and explain the algorithm for binary search. Analyze its time complexity.
17. What is a hash table? Explain collision resolution techniques with examples.
18. Discuss Dijkstra’s algorithm for finding the shortest path in a graph. Solve a problem
using this algorithm.
19. Compare and contrast the merge sort and quick sort algorithms with examples.
20. Explain the different types of tree traversal methods with examples.

Programming/Code-Based Questions

21. Write a program to implement a linked list and perform insert, delete, and display
operations.
22. Write a function to reverse a string using a stack.
23. Implement a program to find the factorial of a number using recursion.
24. Write a program to check whether a given string is a palindrome using a queue.
25. Implement a binary search algorithm in C++/Python.

You might also like