0% found this document useful (0 votes)
10 views4 pages

DSA-II Assignment-1

This document outlines an assignment for the Data Structures and Algorithm-II course for B.Tech students, detailing the questions to be answered and submission guidelines. The assignment includes topics such as tree data structures, binary trees, AVL trees, and Huffman coding, with specific tasks like coding, algorithms, and proofs. It emphasizes the importance of originality and proper formatting in submissions.

Uploaded by

park.aera0901
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)
10 views4 pages

DSA-II Assignment-1

This document outlines an assignment for the Data Structures and Algorithm-II course for B.Tech students, detailing the questions to be answered and submission guidelines. The assignment includes topics such as tree data structures, binary trees, AVL trees, and Huffman coding, with specific tasks like coding, algorithms, and proofs. It emphasizes the importance of originality and proper formatting in submissions.

Uploaded by

park.aera0901
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/ 4

Data Structures And Algorithm-II SESSION: 2024-25

(BCSE-0401)
COURSE/SEM: B.TECH/IVth
UNIT-I
Assignment Given Date: 12/03/2025
Assignment Submission Date: 25/03/2025 MAXIMUM MARKS: 10
Faculty Name: - Manoj Yadav Faculty Mail Id: [email protected]
INSTRUCTIONS:

1. Submit the assignment before the due date.


2. Avoid copying the assignment, if found student will be penalized accordingly.
3. Mention all the necessary details in your pdf file. All assignments should be in a pdf file format. No
other format will be entertained.

BLOOM’S
Q. No. Question Statement CO KNOWLEDGE
LEVEL

1. Discuss terminology in Tree data structure with help of a CO1 K1


proper example for each term.

2. “Binary Tree data structure can be represented by using array CO1 K1


and linked list.” Discuss the validity of the above statement
with proper example.
3. Give the C code for the following:
i. In-Order Traversal
ii. Pre-Order Traversal CO1 K2
iii. Post-Order Traversal

4.  Give an algorithm to find the maximum element in a


binary tree.
 Give an algorithm for finding the size of binary tree.
 Give an algorithm for finding the height (or depth) of CO1 K2
the binary tree.
 Give an algorithm for finding the number of full
nodes in the binary tree without using recursion.
5. Prove the following statement:
i. Prove that in a binary tree ‘T’ the maximum nodes at
any level ‘L’ is 𝟐𝒍 .
ii. Prove that in a binary tree ‘T’ the maximum number of
nodes with height is 𝟐𝒉+𝟏 − 𝟏. CO1 K4
iii. For any binary tree (non-empty) ‘T’ prove that
𝒏𝟎 = 𝒏𝟐 + 𝟏 where, 𝒏𝟎 =
𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒏𝒐𝒅𝒆𝒔 𝒐𝒇 𝒅𝒆𝒈𝒓𝒆𝒆 𝟎 (𝒊. 𝒆. 𝒏𝒐 𝒄𝒉𝒊𝒍𝒅) and
𝒏𝟐 =
𝑵𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒏𝒐𝒅𝒆𝒔 𝒐𝒇 𝒅𝒆𝒈𝒓𝒆𝒆 𝟐 (𝒊. 𝒆. 𝟐 𝒄𝒉𝒊𝒍𝒅𝒓𝒆𝒏)
iv. Prove that the height of a complete binary tree is logn.
6. Find the In-Order, Pre-Order and Post-Order Traversal for
the following Binary Tree:

CO1 K2
7. Create a Binary Tree from the given traversal:
i. Pre-Order: 1 2 4 5 3 6
CO1 K2
In-Order: 4 2 5 1 6 3
ii. In-Order: 40 20 50 10 60 30
Post-Order: 40 50 20 60 30 10
iii. Pre-Order: A B D I J F C G K H
In-Order: I D J B F A G K C H

8. Define Binary Search Tree. Give a program to implement CO1 K3


BST and to insert and delete in BST.
9. Construct a Binary Search Tree by inserting the following
sequence of number: 10,12,5,4,20,8,7,15 and 13.

After creating the binary tree delete the following node: CO1 K2
13, 5 and 10 from the above binary search tree created.
10. Create an AVL Tree from the given nodes:
i. 21,26,30,9,4,14,28,18,15,10,2,3,7
ii. Create an AVL tree by inserting numbers from 1 to 10.
CO1 K4
iii. Create an AVL tree by inserting the following sentence:
“Jump dogs bad ”.
11. Perform Deletion in AVL Tree from the tree created above in
the sequence mentioned below:
i. 2, 15, 9, 21,14 CO1 K3
ii. 8, 7, 2, 6

12. Discuss the following with proper example: CO1 K2


i. Binary Heaps
ii. Priority Queue

13. Perform Heap Sort on the following listed numbers and give CO1 K2
the algorithm to perform heap sort for the same.
82, 90, 10, 12, 15, 77, 55, 23
14. What are Threaded Binary Trees. Discuss its advantages and CO1 K2
disadvantages.
15. Explain Huffman Coding with the proper algorithm and
solve the problem below:

A file contains the following characters with the frequencies


as shown. If Huffman Coding is used for data compression,
determine- CO1 K3
1. Huffman Code for each character
2. Average code length
3. Length of Huffman encoded message (in bits)
CHARACTERS FREQUENCIES
A 10
E 15
I 12
O 3
U 4
S 13
T 1

You might also like