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

DSA Unit3 Assignment[1]

The document outlines an assignment for a Data Structures and Algorithms course focusing on trees and graphs in C++. It includes questions on basic tree concepts, binary tree operations, binary search trees, AVL trees, B-trees, and graph concepts, along with implementation tasks in C++. The assignment requires students to define terms, write programs for various tree and graph operations, and explain key concepts with diagrams.

Uploaded by

sunilksuthar8320
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)
1 views

DSA Unit3 Assignment[1]

The document outlines an assignment for a Data Structures and Algorithms course focusing on trees and graphs in C++. It includes questions on basic tree concepts, binary tree operations, binary search trees, AVL trees, B-trees, and graph concepts, along with implementation tasks in C++. The assignment requires students to define terms, write programs for various tree and graph operations, and explain key concepts with diagrams.

Uploaded by

sunilksuthar8320
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/ 2

Assignment

Subject: DSA -→ UNIT-3

TREES ASSIGNMENT QUESTIONS (C++)

Basic Tree Concepts


1. Define and explain the following terms with diagrams: root, leaf,
internal node, degree, level, height, sibling.
2. Write a C++ program to represent a binary tree using structures and
pointers.

Binary Tree Operations & Traversals


3. Implement inorder, preorder, and postorder tree traversals using both
recursion and iteration.
4. Write a program to count the number of leaf nodes, non-leaf nodes,
and total nodes in a binary tree.
5. Implement a function to find the height/depth of a binary tree.
6. Write a program to copy a binary tree into another binary tree.
7. Implement a function to mirror a binary tree.

Types & Applications of Trees


8. Write a program to check if a binary tree is complete or perfect.
9. Explain and implement a Threaded Binary Tree.
10.Write a program to convert an expression into an expression tree and
evaluate it.

BINARY SEARCH TREES (BST), AVL, B-TREES

Binary Search Tree (BST)


11.Implement a Binary Search Tree with insertion, deletion, and search
operations.
12.Write a program to find the inorder successor and predecessor of a
node in BST.
13.Write a program to delete a node in BST (handle all 3 cases).

AVL Trees
14.Implement an AVL Tree with insertion operation and display all
rotations.
Assignment
15.Write a function to check whether a given binary tree is height-
balanced.

B-Tree and B+ Tree


16.Write a program to implement insertion and search operation in a B-
Tree (order 3).
17.Write a short note and diagrammatically explain how B+ Trees differ
from B-Trees.

GRAPHS ASSIGNMENT QUESTIONS (C++)

Basic Graphs Concepts


18.Explain with example: adjacency matrix and adjacency list. Implement
both using C++.
19.Implement a graph and perform DFS and BFS traversals (using
recursion or stack/queue).

Graph Applications
20.Implement Dijkstra’s Algorithm to find the shortest path from a source
node.
21.Implement Topological Sorting using Kahn’s Algorithm or DFS.
22.Implement Prim's and Kruskal’s Algorithm for Minimum Spanning Tree.

***THE END***

You might also like