0% found this document useful (0 votes)
16 views3 pages

Dsa Short Answer Questions

Uploaded by

mohanraj08052006
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)
16 views3 pages

Dsa Short Answer Questions

Uploaded by

mohanraj08052006
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/ 3

Unit 3

1. Define Graph

A graph is a data structure consisting of vertices (nodes) and edges connecting them.

It can be directed or undirected, weighted or unweighted.

2. Define Sorting

Sorting is the process of arranging elements in a specific order, like ascending or descending.

Common methods include Bubble, Merge, Quick, and Insertion sort.

3. Difference Between Binary Tree and Binary Search Tree

A binary tree has at most two children per node.

A binary search tree (BST) maintains a specific order: left < root < right.

4. Difference Between Full and Complete Binary Tree

Full: Every node has 0 or 2 children.

Complete: All levels are filled except possibly the last, filled left to right.

5. Difference Between Internal and External Sorting

Internal: Sorting happens in RAM for small datasets.

External: Uses external storage for large datasets.

6. Define Load Factor

Load factor is the ratio of elements in a hash table to its total size.

Higher load factors can increase collisions.

7. Different Types of Hashing

Hashing types include direct hashing, chaining, and open addressing (linear, quadratic, double).

They handle collisions differently.

8. Define Hashing

Hashing maps data to a fixed-size table using a hash function.

It allows constant-time data access in the average case.


9. Define Extendable Hashing

Extendable hashing dynamically resizes hash tables.

It reduces collisions by splitting buckets as needed.

Unit 4

1. Define Tree

A tree is a hierarchical data structure with a root and connected child nodes.

Each child has only one parent.

2. Define Forest

A forest is a collection of disjoint trees.

Removing the root from a tree can create a forest.

3. Define Euler's Circuit

An Euler's circuit is a path that starts and ends at the same vertex.

It visits every edge exactly once.

4. Define Biconnectivity

A graph is biconnected if it remains connected after removing any one vertex.

It has no articulation points.

5. Difference Between NP and NP-Complete

NP: Problems verifiable in polynomial time.

NP-Complete: The hardest problems in NP; solving one solves all NP problems.

6. Given a Graph, Find In and Out Degree

In-degree: Number of edges entering a node.

Out-degree: Number of edges leaving a node.

7. Define Topological Order

A topological order is a linear ordering of vertices in a directed acyclic graph (DAG).

It ensures edges (u → v) are directed from earlier to later in the order.


8. Given a Graph, Find Topological Order

Use algorithms like DFS or Kahn's Algorithm to find the order.

It’s valid only for DAGs.

9. Define AVL

AVL is a self-balancing binary search tree.

The height difference (balance factor) between left and right subtrees is at most 1.

10. Difference Between B Tree and B+ Tree

B-Tree: Keys and data stored in internal and leaf nodes.

B+ Tree: Keys in internal nodes; data only in leaf nodes.

11. Properties Available in AVL

Balance factor must be -1, 0, or 1.

Rotations (single or double) are performed to maintain balance.

Unit 5

1.Define Strongly Connected, Directed, Undirected, DAG, and Complete Graph.

Strongly Connected: All vertices reachable from each other in a directed graph.

Directed: Edges have a direction (u → v).

Undirected: Edges have no direction.

DAG: Directed Acyclic Graph; no cycles.

Complete: Every vertex connects to all others.

2. Difference Between Adjacency Matrix and List

Adjacency Matrix: 2D array; requires O(V²) space.

Adjacency List: List of lists; requires O(V + E) space. Unit 3

You might also like