0% found this document useful (0 votes)
1K views6 pages

Important Questions for CD3291 DSA

interest

Uploaded by

keerthiga
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)
1K views6 pages

Important Questions for CD3291 DSA

interest

Uploaded by

keerthiga
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
  • UNIT 1
  • UNIT III
  • UNIT II
  • UNIT IV
  • UNIT V

CD3291 - DATA STRUCTURES AND ALGORITHMS

UNIT 1

Part A

1. What is mean by data structures?

2. What is abstract data type? What are all not concerned in an ADT?

3. How do you measure the efficiency of an algorithm.

4. What is the best, worst and average case time complexities of linear search
algorithm?

5. What is meant by divide and conquer technique?

6. Write a python program to create a class CIRCLE. Also find the area of circle.

7. Explain the concept of polymorphism.

8. Define namespace. What are the types of namespace?

9. Differentiate time and space complexity.

10. Define recursion.

Part B

1. Explain the concept of single and multiple inheritance with example program.

2. Explain shallow and deep copying.

3. Discuss in detail all the asymptotic notations with examples.

4. Explain divide and conquer technique.

5. Explain the towers of Hanoi problem and solve it using recursion.

6. Explain the concept of multilevel and hybrid inheritance with example program.

Page: 1 / 5
UNIT – II

PART-A

1. What is a linked list?

2. Differentiate between arrays and list.

3. What is the advantage of linked list over arrays?

4. What is static linked list? State any two applications of it.

5. Write the applications of stack?

6. Write any four applications of queue.

7. Differentiate stack and queue.

8. What is mean by DEQUE?

9. Write the class for doubly linked list.

10. Draw the implementation diagram of circular linked list.

PART – B

1. Write the array based implementation program.

2. Explain the concept of singly linked list with example.

3. Write the program for traversal in doubly linked list.

4. Write the program for insertion in circular linked list.

5. Explain the operations of stack with example program.

6. Explain the operations of queue with example program.

7. Write the program for Double ended queues.

UNIT – III

PART-A

Page: 2 / 5
1. What is the importance of sorting and searching techniques?

2. Differentiate between internal and external sorting.

3. Compare linear and binary search.

4. What is the time complexity of linear and binary search?

5. What is the time complexity of insertion sort?

6. What is hashing?

7. List out various techniques of hashing.

8. What is rehashing?

9. What are the advantages and disadvantages of separate chaining and linear
probing?

10. List out the collision handling techniques of

hashing. PART – B

1. Write a python program to perform bubble sort and insertion sort.

2. Write a function to perform merge sort. Give example.

3. Explain the following searching algorithms with example. a) Linear search b)


Binary search

4. Give the input {4371,1323,6173,4199,4344,9679,1989} and hash function


h(X)=X(mod 10), show the results for the following: i) Open addressing hash table
using linear probing ii) Open addressing hash table using quadratic probing iii)
Open addressing hash table with second hash function h2(X)=7-(X mod 7).

5. Consider a hash table with 9 slots. The hash function is h(K)=k mod 9. The
following keys are inserted in the order 5,28,19,15,20,33,12,17,10. Draw the
contents of the hash table when the collisions are resolved by i) Chaining ii) Linear
probing iii) Double hashing The second hash function h2(x)=7-(x mod 7).

6. When do you perform rehashing? Illustrate with example.

Page: 3 / 5
UNIT – IV

PART-A
1. Define binary tree.

2. Differentiate between complete and full binary tree.

3. List the applications of trees.

4. What is level of a tree?

5. How are binary tree represented using an array and linked list? Give example.

6. Construct an expression tree for the expression A+(B-C)*D*(E+F).

7. Define binary search tree.

8. Write an algorithm to declare nodes of a tree structure.

9. What is meant by equivalent binary tree.

10. How to resolve the null links in a binary tree?

PART – B

11. Explain the representation of binary tree.

2. Explain the tree traversal techniques with example.

3. What are the expression trees. Write the procedure for constructing an
expression tree.

4. How to insert and delete an element into binary search tree and write down the
code for the insertion routine with an example.

5. i) Show the result of inserting 43,11,69,72 and 30 into an initially empty AVL
tree. Show the results of deleting the nodes 11 and 72 one after the other of
constructed tree. ii) Explain the AVL rotations with a suitable example. 16.i)
Explain the insert and delete operations of heap with examples. ii) State algorithm
to sort elements of a given array in ascending order using heapsort. Sort the

Page: 4 / 5
following numbers using heap sort:48,0,-1,82,108,72,54 [Link] a B-Tree
with order m=3 for the key values 2,3,7,9,5,6,4,8,1 and delete the values 4 and 6.
Show the tree in performing all the operations.

UNIT – V

PART-A

1. Define binary tree.

2. Differentiate between complete and full binary tree.

3. List the applications of trees.

4. What is level of a tree?

5. How are binary tree represented using an array and linked list? Give example.

6. Construct an expression tree for the expression A+(B-C)*D*(E+F).

7. Define binary search tree.

8. Write an algorithm to declare nodes of a tree structure.

9. What is meant by equivalent binary tree.

10. How to resolve the null links in a binary tree?

PART – B

1. Explain the representation of graph.

2. Explain depth first and breadth first traversal.

3. State and explain topological sort with suitable example.

4. Explain Dijkstra’s algorithm with an example.

5. State prim’s algorithm to find minimum spanning tree with example.

6. State Kruskal’s algorithm with an example.

Page: 5 / 5

Common questions

Powered by AI

Abstract Data Types (ADTs) provide a theoretical framework for the implementation of data structures by defining a data type solely by its behavior, such as possible values and operations, without specifying its implementation. In contrast, data structures are concrete implementations of these abstract concepts using programming languages. The distinction is important because ADTs help in focusing on what a program should do, rather than how it does it, allowing for greater abstraction and modularity in software engineering .

Trees are hierarchical structures with a single root and potentially many levels of descendants, typically used to represent hierarchical data and facilitate fast lookup, insertion, and deletion operations, leveraging traversal algorithms like in-order, pre-order, and post-order. Graphs, by contrast, are more general structures composed of nodes (vertices) and edges, capable of representing a network of arbitrary connections, applicable to problems like social network analysis and routing problems. The traversal algorithms differ in complexity: tree traversals are more straightforward due to the structured nature, while graph traversal algorithms like depth-first search and breadth-first search handle more complexity due to the potential for cycles and disconnected components in graphs .

A circular linked list connects the last node back to the first node, creating a continuous loop. This structure allows efficient traversal from any node and is particularly advantageous in applications requiring a circular iteration over elements, such as buffer management in streaming data or implementing the round-robin scheduling algorithm. Its advantage over conventional linked lists lies in the ease of implementing algorithms where the process needs to repeatedly traverse the data set .

The divide and conquer technique improves algorithm efficiency by breaking a problem into smaller sub-problems, solving each independently, and combining their results to solve the original problem. This approach simplifies complex problems and can lead to significant performance improvements, particularly in reducing time and space complexity. Classical examples include merge sort, quick sort, and binary search algorithms, which all leverage this method to enhance their efficiency .

Linked lists offer several advantages over arrays, notably in dynamic memory usage and efficient insertions and deletions. Unlike arrays, linked lists do not require a contiguous memory block, saving memory and avoiding large reallocation costs. Additionally, linked lists can easily grow and shrink in size without costly array resizing operations, and elements can be inserted or removed efficiently from any position in the list .

Hashing is a crucial technique in data structures for providing fast data retrieval, with hash tables allowing average time complexities of O(1) for lookups, insertions, and deletions. Collision handling is vital to maintaining efficiency, commonly managed through techniques like separate chaining and open addressing (including linear probing, quadratic probing, and double hashing). Separate chaining is simple and avoids clustering, but it requires extra memory for pointers. Open addressing has better cache performance, but is susceptible to clustering, which can degrade performance .

An AVL tree is a self-balancing binary search tree, ensuring that the heights of two child subtrees of any node differ by no more than one. When insertions or deletions cause the tree to rotate out of balance, AVL rotations (single or double rotations) are applied to restore height balance. These rotations effectively redistribute nodes while maintaining the binary search tree properties, ensuring the tree remains balanced, which guarantees O(log n) time complexity for insertions, deletions, and lookups .

Shallow copying creates a new object but shares references to the original object's nested objects, meaning changes in nested objects affect both copies. In contrast, deep copying creates a completely independent copy of both the object and its nested elements, ensuring changes to the copy do not affect the original. The choice between shallow and deep copying significantly affects memory management and performance, with shallow copying being more memory-efficient but potentially riskier in terms of unwanted side effects .

Internal sorting occurs when all data fits into the main memory, making algorithms like quick sort, merge sort, and heap sort suitable due to their efficient in-memory operations. External sorting is necessary when data exceeds main memory capacity, requiring it to be sorted in chunks and combined later, as seen in the external merge sort. Internal sorting is ideal for speed with smaller datasets, while external sorting handles large data volumes by optimizing I/O operations .

Binary search is significantly more efficient than linear search, especially for large, sorted datasets. Binary search operates with a time complexity of O(log n), where n is the number of elements, by repeatedly dividing the search interval in half. In contrast, linear search has a time complexity of O(n), requiring a sequential check of each element, one by one, until the desired element is found .

Page: 1 / 5
CD3291 - DATA STRUCTURES AND ALGORITHMS
UNIT 1
Part A
1. What is mean by data structures?
2. What is abstract dat
Page: 2 / 5
UNIT – II
PART-A
1. What is a linked list?
2. Differentiate between arrays and list.
3. What is the advantage of
Page: 3 / 5
1. What is the importance of sorting and searching techniques?
2. Differentiate between internal and external sor
Page: 4 / 5
UNIT – IV
PART-A
1. Define binary tree.
2. Differentiate between complete and full binary tree.
3. List the appli
Page: 5 / 5
following numbers using heap sort:48,0,-1,82,108,72,54 17.Construct a B-Tree
with order m=3 for the key values 2,

You might also like