We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

Assignment No. 01 (Graded)
SEMESTER Fall 2018
CS301- Data Structures

Total Marks: 20

Due Date:  10 /12 /18

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit (zero marks) if:

o        The assignment is submitted after due date.

o        The submitted assignment is other than .cpp file.

o        The submitted assignment does NOT open or file is corrupted.

o        The assignment is copied (from other student or ditto copy from handouts or internet).

Uploading instructions

o   For clarity and simplicity, you are required to Upload/Submit only .cpp file.

Objective

The objective of this assignment is:

o   To make you understand the different traversal forms of a Binary Search Tree data structure.

 

For any query about the assignment, contact at cs301@vu.edu.pk

GOOD LUCK

 

Marks: 20 

 

Binary Search tree is the most efficient data structure for solving different problems. Construction of BST (Binary Search Tree) depends on the order in which data is inserted into the tree. For building a Binary Search Tree, data should be inserted into a tree in a way that nodes with smaller data values appears on left side and larger node values appears on right side of the root node.

Write a menu based system program in C++ that will allow you to:

Enter Employee data in BST

buildBST()

Post order traversal of all the Employee data

postOrder()

Show data in ascending order

asscendingOrder()

 

Take the following attributes of an Employee from the user:

empId, empNname, empSalary

You have to implement the above scenario using BST on the basis of Employee Id. i.e. if the Id of the Employee is lesser than the root node then enter the next Employee data in the left child otherwise in right child.

Note:

  • BST will implement using Linked List.
  • Program will not allow entering duplicate employee id.
  • Design the program in a way that the user will be able to enter maximum 10 records.
  • Take empId, empName, empSalary from the user. At least 4 students record should be already entered (hard coded records).

You will use following already entered Employees data (hard coded records).

Emp Id

Name

EmpSalary

32

Raza

3000

56

Sajjad

25000

93

Rabia

19230

5

Sehar

24000

10

Ali

22200

 

 

 

 

 

 

Solution Guidelines:

  • You will use buildBST() method to build Binary Search Tree from the above given data.
  • Use the ascendingOredr() method to show the output in ascending order. With respect to empId.
  • Use postOrder() method to traverse the records in post-order.

 

 

Sample output 1:

Sample output 2:

 

 

 Fall%202018_CS301_1.docx


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 402

Attachments:

Reply to This

Replies to This Discussion

Mjy b soln chaiye

solution hea lakan ak error he us mn

If anyone need best solution, then watch the below video

click here to watch CS301 best solution

Click here to watch CS301 best solution

click here for CS301 correct solution

RSS

Latest Activity

Saarim posted a status
"Jis Raat Mehakti Hain Kisi Raat Ki Yaadain Us Raat Guzarti He Nahin Raat Hamari"
21 minutes ago
UZMA joined +M.Tariq Malik's group
1 hour ago
khaaniii updated their profile
1 hour ago
maheen updated their profile
1 hour ago
UZMA liked +M.Tariq Malik's discussion ENG501 Mid Term Papers Spring 2019 (15~28-June 2019) & All Solved Past Papers, Solved MCQs & Helping Material
1 hour ago
UZMA liked +M.Tariq Malik's discussion ENG501 Mid Term Papers Spring 2019 (15~28-June 2019) & All Solved Past Papers, Solved MCQs & Helping Material
1 hour ago
UZMA replied to +M.Tariq Malik's discussion ENG501 History of English Language Online Quiz No 01 spring 2020 Solution Discussion in the group ENG501 History of English Language
1 hour ago
UZMA replied to +M.Tariq Malik's discussion ENG501 History of English Language Online Quiz No 01 spring 2020 Solution Discussion in the group ENG501 History of English Language
1 hour ago
UZMA commented on +M.Tariq Malik's group ENG501 History of English Language
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion PAD603 GDB No 01 Fall 2020 Solution / Discussion in the group PAD603 Governance, Democracy and Society
1 hour ago
UZMA joined +M.Tariq Malik's group
1 hour ago
+M.Tariq Malik added a discussion to the group PAD603 Governance, Democracy and Society
1 hour ago

Looking For Something? Search Here

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.