Assignment No. 2
Semester: Fall 2016
CS301 – Data Structures
Total Marks: 20
Due Date:Tuesday, November 29, 2016
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/ to from students).
For clarity and simplicity, You are required to Upload/Submit only ONE .CPP file. Other format will not be accepted and will be graded zero marks.
Note: Use ONLY Dev-C++ IDE for writing and executing your code.
The purpose of this assignment is to make you familiar with following topics:
• Binary Tree
• Terminologies of a Binary Tree
• Complete Binary Tree
• Level of a Complete Binary Tree
Assignment Submission Instructions
You have to submit only .cpp on the Assignments interface of CS301 at VULMS. Assignment submitted in any other format will not be accepted and will be graded zero marks.
Question 1: Marks= 20
Write down C++ code to create a complete binary Tree in which user can add any number of node/elements (Numeric). After Creating a complete binary tree , You need to calculate the product of the 2nd lowest level and find the smallest number in the binary tree as given in the example
Product of Elements in 2nd last level (N-1)= 20
Smallest number in Binary Tree = 2
Note: N levels mean any number of levels.
Your assignment must be uploaded on or before Tuesday, November 29, 2016. We shall not accept your solution through email after the due date.